注意这更多是iOS故障排除问题,而不是React Native问题。因此,即使您是iOS开发人员,而不是专门从事React Native,也请进一步阅读。非常感谢您的帮助:)
我正在使用https://github.com/syanbo/react-native-agora的react native包装器通过Agora SDK构建React Native应用程序
发起新的视频通话时,我遇到一个奇怪的问题,出现以下错误:
2019-01-23 16:20:18.512762+0530 PwcApp[786:355367] Exception '-[AgoraRtcEngineKit setClientRole:withKey:]: unrecognized selector sent to instance 0x1072a7b80' was thrown while invoking init on target Agora with params (
{
appid = c617eddc6ceb4782adb509aa91b17580;
channelProfile = 1;
clientRole = 1;
swapWidthAndHeight = 1;
videoProfile = 40;
}
)
callstack: (
0 CoreFoundation 0x00000001beb37f10 <redacted> + 252
1 libobjc.A.dylib 0x00000001bdd05a40 objc_exception_throw + 56
2 CoreFoundation 0x00000001bea4f154 <redacted> + 0
3 CoreFoundation 0x00000001beb3d810 <redacted> + 1412
4 CoreFoundation 0x00000001beb3f4bc _CF_forwarding_prep_0 + 92
5 PwcApp 0x00000001055f48f4 -[RCTAgora init:] + 1200
6 CoreFoundation 0x00000001beb3f660 <redacted> + 144
7 CoreFoundation 0x00000001bea1b980 <redacted> + 292
8 CoreFoundation 0x00000001bea1c564 <redacted> + 60
9 PwcApp 0x00000001048fa30c -[RCTModuleMethod invokeWithBridge:module:arguments:] + 492
10 PwcApp 0x000000010493fa60 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 248
11 PwcApp 0x000000010493f7bc ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 88
12 libdispatch.dylib 0x0000000106e87840 _dispatch_call_block_and_release + 24
13 libdispatch.dylib 0x0000000106e88de4 _dispatch_client_callout + 16
14 libdispatch.dylib 0x0000000106e96a94 _dispatch_main_queue_callback_4CF + 1360
15 CoreFoundation 0x00000001beac61bc <redacted> + 12
16 CoreFoundation 0x00000001beac1084 <redacted> + 1964
17 CoreFoundation 0x00000001beac05b8 CFRunLoopRunSpecific + 436
18 GraphicsServices 0x00000001c0d34584 GSEventRunModal + 100
19 UIKitCore 0x00000001eb507558 UIApplicationMain + 212
20 PwcApp 0x0000000104787240 main + 124
21 libdyld.dylib 0x00000001be580b94 <redacted> + 4
)
此错误仅在发布版本上发生。调试运行完全正常。从到目前为止我能收集到的所有信息中,我发现有几个共同的罪魁祸首。本质上,我试图消除Release和Debug之间的差异。到目前为止,我已经尝试过:
Strip debug symbols on copy
设置为NO(与debug设置相同)。Dead code stripping
设置为NO(与debug设置相同)。Build Active Architecture only
设置为NO(与debug设置相同)。Optimization level
设置为NONE [-O0](与debug相同)。以上似乎都无法解决问题。因此,我现在的主要问题是如何进行故障排除?我可以尝试的调试/发布版本之间是否还有其他设置有所不同?