本文将纪录svg遇到的问题
SVG不可嵌套RN提供的UI组件
- SVG不可嵌套RN提供的UI组件,例如:
<Text />
,<View />
,<Image />
...,报错类似如下(其中RCTText可能为RCTView,RCTImageView)
2016-04-14 20:08:27.661 Jam[29204:1352608] -[RCTText renderTo:]: unrecognized selector sent to instance 0x7f9ee3df9d10
2016-04-14 20:08:27.663 Jam[29204:1352608] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RCTText renderTo:]: unrecognized selector sent to instance 0x7f9ee3df9d10'
*** First throw call stack:
(
0 CoreFoundation 0x00000001030d3e65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001022cfdeb objc_exception_throw + 48
2 CoreFoundation 0x00000001030dc48d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010302990a ___forwarding___ + 970
4 CoreFoundation 0x00000001030294b8 _CF_forwarding_prep_0 + 120
5 Jam 0x0000000101a8284d -[ARTSurfaceView drawRect:] + 349
6 UIKit 0x0000000104c18f08 -[UIView(CALayerDelegate) drawLayer:inContext:] + 495
7 QuartzCore 0x000000010495a183 -[CALayer drawInContext:] + 257
8 QuartzCore 0x000000010484f33d CABackingStoreUpdate_ + 2688
9 QuartzCore 0x000000010495a002 ___ZN2CA5Layer8display_Ev_block_invoke + 59
10 QuartzCore 0x0000000104959e80 _ZN2CA5Layer8display_Ev + 1460
11 QuartzCore 0x000000010494ec69 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 293
12 QuartzCore 0x000000010494ecf9 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 35
13 QuartzCore 0x0000000104943475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
14 QuartzCore 0x0000000104970c0a _ZN2CA11Transaction6commitEv + 486
15 QuartzCore 0x000000010497137c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
16 CoreFoundation 0x0000000102fff367 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
17 CoreFoundation 0x0000000102fff2d7 __CFRunLoopDoObservers + 391
18 CoreFoundation 0x0000000102ff4f2b __CFRunLoopRun + 1147
19 CoreFoundation 0x0000000102ff4828 CFRunLoopRunSpecific + 488
20 GraphicsServices 0x0000000107d04ad2 GSEventRunModal + 161
21 UIKit 0x0000000104b62610 UIApplicationMain + 171
22 Jam 0x0000000101a8118f main + 111
23 libdyld.dylib 0x00000001061ac92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)