更新到 Xcode 11.0 后反应本机崩溃
Posted
技术标签:
【中文标题】更新到 Xcode 11.0 后反应本机崩溃【英文标题】:react native crash after update to Xcode 11.0 【发布时间】:2019-10-11 08:04:08 【问题描述】:我刚刚将 Xcode 更新到 11.0 版,现在当我在插入的 iPhone 上从 Xcode 运行我的 react 本机应用程序时,应用程序在本机调用时崩溃:
2019-10-11 09:52:42.402 [fatal][tid:main] Exception '*** -[__NSArrayM objectAtIndexedSubscript:]: index 1 beyond bounds [0 .. 0]' was thrown while invoking getCurrentAppState on target AppState with params (
2,
3
)
callstack: (
0 CoreFoundation 0x000000020ae29294 <redacted> + 252
1 libobjc.A.dylib 0x000000020a0039f8 objc_exception_throw + 56
2 CoreFoundation 0x000000020ada2ce8 _CFArgv + 0
3 CoreFoundation 0x000000020ad27cfc <redacted> + 0
4 MyApp 0x000000010084dfac -[RCTModuleMethod processMethodSignature] + 10144
5 MyApp 0x00000001008526d4 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 164
6 MyApp 0x00000001008e488c _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660
7 MyApp 0x00000001008e4400 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144
8 MyApp 0x00000001008e4364 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
9 libdispatch.dylib 0x0000000101dcb6f0 _dispatch_call_block_and_release + 24
10 libdispatch.dylib 0x0000000101dccc74 _dispatch_client_callout + 16
11 libdispatch.dylib 0x0000000101dda6fc _dispatch_main_queue_callback_4CF + 1360
12 CoreFoundation 0x000000020adbac1c <redacted> + 12
13 CoreFoundation 0x000000020adb5b54 <redacted> + 1924
14 CoreFoundation 0x000000020adb50b0 CFRunLoopRunSpecific + 436
15 Foundation 0x000000020b782fac <redacted> + 300
16 Foundation 0x000000020b782e3c <redacted> + 96
17 MyApp 0x0000000100796c94 +[RNSplashScreen show] + 308
18 MyApp 0x00000001006e4d7c -[AppDelegate application:didFinishLaunchingWithOptions:] + 444
19 UIKitCore 0x00000002375dbe30 <redacted> + 412
20 UIKitCore 0x00000002375dd594 <redacted> + 3352
21 UIKitCore 0x00000002375e2d20 <redacted> + 1540
22 UIKitCore 0x0000000236ea62dc <redacted> + 776
23 UIKitCore 0x0000000236eae874 <redacted> + 160
24 UIKitCore 0x0000000236ea5f60 <redacted> + 236
25 UIKitCore 0x0000000236ea6850 <redacted> + 1064
26 UIKitCore 0x0000000236ea4b9c <redacted> + 744
27 UIKitCore 0x0000000236ea4864 <redacted> + 428
28 UIKitCore 0x0000000236ea93a4 <redacted> + 220
29 UIKitCore 0x0000000236eaa188 _performActionsWithDelayForTransitionContext + 112
30 UIKitCore 0x0000000236ea925c <redacted> + 244
31 UIKitCore 0x0000000236eadf5c <redacted> + 360
32 UIKitCore 0x00000002375e1328 <redacted> + 540
33 UIKitCore 0x00000002371ddba8 <redacted> + 360
34 FrontBoardServices 0x000000020d7a49fc <redacted> + 440
35 FrontBoardServices 0x000000020d7ae40c <redacted> + 256
36 FrontBoardServices 0x000000020d7adc14 <redacted> + 64
37 libdispatch.dylib 0x0000000101dccc74 _dispatch_client_callout + 16
38 libdispatch.dylib 0x0000000101dd0840 _dispatch_block_invoke_direct + 232
39 FrontBoardServices 0x000000020d7df040 <redacted> + 40
40 FrontBoardServices 0x000000020d7decdc <redacted> + 408
41 FrontBoardServices 0x000000020d7df294 <redacted> + 52
42 CoreFoundation 0x000000020adbb018 <redacted> + 24
43 CoreFoundation 0x000000020adbaf98 <redacted> + 88
44 CoreFoundation 0x000000020adba880 <redacted> + 176
45 CoreFoundation 0x000000020adb57bc <redacted> + 1004
46 CoreFoundation 0x000000020adb50b0 CFRunLoopRunSpecific + 436
47 GraphicsServices 0x000000020cfb579c GSEventRunModal + 104
48 UIKitCore 0x00000002375e4978 UIApplicationMain + 212
49 MyApp 0x00000001006e551c main + 124
50 libdyld.dylib 0x000000020a87a8e0 <redacted> + 4
)
2019-10-11 09:52:42.407068+0200 MyApp[309:11033] Exception '*** -[__NSArrayM objectAtIndexedSubscript:]: index 1 beyond bounds [0 .. 0]' was thrown while invoking getCurrentAppState on target AppState with params (
2,
3
)
callstack: (
0 CoreFoundation 0x000000020ae29294 <redacted> + 252
1 libobjc.A.dylib 0x000000020a0039f8 objc_exception_throw + 56
2 CoreFoundation 0x000000020ada2ce8 _CFArgv + 0
3 CoreFoundation 0x000000020ad27cfc <redacted> + 0
4 MyApp 0x000000010084dfac -[RCTModuleMethod processMethodSignature] + 10144
5 MyApp 0x00000001008526d4 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 164
6 MyApp 0x00000001008e488c _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660
7 MyApp 0x00000001008e4400 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144
8 MyApp 0x00000001008e4364 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
9 libdispatch.dylib 0x0000000101dcb6f0 _dispatch_call_block_and_release + 24
10 libdispatch.dylib 0x0000000101dccc74 _dispatch_client_callout + 16
11 libdispatch.dylib 0x0000000101dda6fc _dispatch_main_queue_callback_4CF + 1360
12 CoreFoundation 0x000000020adbac1c <redacted> + 12
13 CoreFoundation 0x000000020adb5b54 <redacted> + 1924
14 CoreFoundation 0x000000020adb50b0 CFRunLoopRunSpecific + 436
15 Foundation 0x000000020b782fac <redacted> + 300
16 Foundation 0x000000020b782e3c <redacted> + 96
17 MyApp 0x0000000100796c94 +[RNSplashScreen show] + 308
18 MyApp 0x00000001006e4d7c -[AppDelegate application:didFinishLaunchingWithOptions:] + 444
19 UIKitCore 0x00000002375dbe30 <redacted> + 412
20 UIKitCore 0x00000002375dd594 <redacted> + 3352
21 UIKitCore 0x00000002375e2d20 <redacted> + 1540
22 UIKitCore 0x0000000236ea62dc <redacted> + 776
23 UIKitCore 0x0000000236eae874 <redacted> + 160
24 UIKitCore 0x0000000236ea5f60 <redacted> + 236
25 UIKitCore 0x0000000236ea6850 <redacted> + 1064
26 UIKitCore 0x0000000236ea4b9c <redacted> + 744
27 UIKitCore 0x0000000236ea4864 <redacted> + 428
28 UIKitCore 0x0000000236ea93a4 <redacted> + 220
29 UIKitCore 0x0000000236eaa188 _performActionsWithDelayForTransitionContext + 112
30 UIKitCore 0x0000000236ea925c <redacted> + 244
31 UIKitCore 0x0000000236eadf5c <redacted> + 360
32 UIKitCore 0x00000002375e1328 <redacted> + 540
33 UIKitCore 0x00000002371ddba8 <redacted> + 360
34 FrontBoardServices 0x000000020d7a49fc <redacted> + 440
35 FrontBoardServices 0x000000020d7ae40c <redacted> + 256
36 FrontBoardServices 0x000000020d7adc14 <redacted> + 64
37 libdispatch.dylib 0x0000000101dccc74 _dispatch_client_callout + 16
38 libdispatch.dylib 0x0000000101dd0840 _dispatch_block_invoke_direct + 232
39 FrontBoardServices 0x000000020d7df040 <redacted> + 40
40 FrontBoardServices 0x000000020d7decdc <redacted> + 408
41 FrontBoardServices 0x000000020d7df294 <redacted> + 52
42 CoreFoundation 0x000000020adbb018 <redacted> + 24
43 CoreFoundation 0x000000020adbaf98 <redacted> + 88
44 CoreFoundation 0x000000020adba880 <redacted> + 176
45 CoreFoundation 0x000000020adb57bc <redacted> + 1004
46 CoreFoundation 0x000000020adb50b0 CFRunLoopRunSpecific + 436
47 GraphicsServices 0x000000020cfb579c GSEventRunModal + 104
48 UIKitCore 0x00000002375e4978 UIApplicationMain + 212
49 MyApp 0x00000001006e551c main + 124
50 libdyld.dylib 0x000000020a87a8e0 <redacted> + 4
)
2019-10-11 09:52:43.027 [fatal][tid:main] Exception '*** -[__NSArrayM objectAtIndexedSubscript:]: index 1 beyond bounds [0 .. 0]' was thrown while invoking getInitialNotification on target PushNotificationManager with params (
148,
149
)
callstack: (
0 CoreFoundation 0x000000020ae29294 <redacted> + 252
1 libobjc.A.dylib 0x000000020a0039f8 objc_exception_throw + 56
2 CoreFoundation 0x000000020ada2ce8 _CFArgv + 0
3 CoreFoundation 0x000000020ad27cfc <redacted> + 0
4 MyApp 0x000000010084dfac -[RCTModuleMethod processMethodSignature] + 10144
5 MyApp 0x00000001008526d4 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 164
6 MyApp 0x00000001008e488c _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660
7 MyApp 0x00000001008e4400 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144
8 MyApp 0x00000001008e4364 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
9 libdispatch.dylib 0x0000000101dcb6f0 _dispatch_call_block_and_release + 24
10 libdispatch.dylib 0x0000000101dccc74 _dispatch_client_callout + 16
11 libdispatch.dylib 0x0000000101dda6fc _dispatch_main_queue_callback_4CF + 1360
12 CoreFoundation 0x000000020adbac1c <redacted> + 12
13 CoreFoundation 0x000000020adb5b54 <redacted> + 1924
14 CoreFoundation 0x000000020adb50b0 CFRunLoopRunSpecific + 436
15 Foundation 0x000000020b782fac <redacted> + 300
16 Foundation 0x000000020b782e3c <redacted> + 96
17 MyApp 0x0000000100796c94 +[RNSplashScreen show] + 308
18 MyApp 0x00000001006e4d7c -[AppDelegate application:didFinishLaunchingWithOptions:] + 444
19 UIKitCore 0x00000002375dbe30 <redacted> + 412
20 UIKitCore 0x00000002375dd594 <redacted> + 3352
21 UIKitCore 0x00000002375e2d20 <redacted> + 1540
22 UIKitCore 0x0000000236ea62dc <redacted> + 776
23 UIKitCore 0x0000000236eae874 <redacted> + 160
24 UIKitCore 0x0000000236ea5f60 <redacted> + 236
25 UIKitCore 0x0000000236ea6850 <redacted> + 1064
26 UIKitCore 0x0000000236ea4b9c <redacted> + 744
27 UIKitCore 0x0000000236ea4864 <redacted> + 428
28 UIKitCore 0x0000000236ea93a4 <redacted> + 220
29 UIKitCore 0x0000000236eaa188 _performActionsWithDelayForTransitionContext + 112
30 UIKitCore 0x0000000236ea925c <redacted> + 244
31 UIKitCore 0x0000000236eadf5c <redacted> + 360
32 UIKitCore 0x00000002375e1328 <redacted> + 540
33 UIKitCore 0x00000002371ddba8 <redacted> + 360
34 FrontBoardServices 0x000000020d7a49fc <redacted> + 440
35 FrontBoardServices 0x000000020d7ae40c <redacted> + 256
36 FrontBoardServices 0x000000020d7adc14 <redacted> + 64
37 libdispatch.dylib 0x0000000101dccc74 _dispatch_client_callout + 16
38 libdispatch.dylib 0x0000000101dd0840 _dispatch_block_invoke_direct + 232
39 FrontBoardServices 0x000000020d7df040 <redacted> + 40
40 FrontBoardServices 0x000000020d7decdc <redacted> + 408
41 FrontBoardServices 0x000000020d7df294 <redacted> + 52
42 CoreFoundation 0x000000020adbb018 <redacted> + 24
43 CoreFoundation 0x000000020adbaf98 <redacted> + 88
44 CoreFoundation 0x000000020adba880 <redacted> + 176
45 CoreFoundation 0x000000020adb57bc <redacted> + 1004
46 CoreFoundation 0x000000020adb50b0 CFRunLoopRunSpecific + 436
47 GraphicsServices 0x000000020cfb579c GSEventRunModal + 104
48 UIKitCore 0x00000002375e4978 UIApplicationMain + 212
49 MyApp 0x00000001006e551c main + 124
50 libdyld.dylib 0x000000020a87a8e0 <redacted> + 4
)
2019-10-11 09:52:43.038945+0200 MyApp[309:11033] Exception '*** -[__NSArrayM objectAtIndexedSubscript:]: index 1 beyond bounds [0 .. 0]' was thrown while invoking getInitialNotification on target PushNotificationManager with params (
148,
149
)
callstack: (
0 CoreFoundation 0x000000020ae29294 <redacted> + 252
1 libobjc.A.dylib 0x000000020a0039f8 objc_exception_throw + 56
2 CoreFoundation 0x000000020ada2ce8 _CFArgv + 0
3 CoreFoundation 0x000000020ad27cfc <redacted> + 0
4 MyApp 0x000000010084dfac -[RCTModuleMethod processMethodSignature] + 10144
5 MyApp 0x00000001008526d4 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 164
6 MyApp 0x00000001008e488c _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 660
7 MyApp 0x00000001008e4400 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144
8 MyApp 0x00000001008e4364 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
9 libdispatch.dylib 0x0000000101dcb6f0 _dispatch_call_block_and_release + 24
10 libdispatch.dylib 0x0000000101dccc74 _dispatch_client_callout + 16
11 libdispatch.dylib 0x0000000101dda6fc _dispatch_main_queue_callback_4CF + 1360
12 CoreFoundation 0x000000020adbac1c <redacted> + 12
13 CoreFoundation 0x000000020adb5b54 <redacted> + 1924
14 CoreFoundation 0x000000020adb50b0 CFRunLoopRunSpecific + 436
15 Foundation 0x000000020b782fac <redacted> + 300
16 Foundation 0x000000020b782e3c <redacted> + 96
17 MyApp 0x0000000100796c94 +[RNSplashScreen show] + 308
18 MyApp 0x00000001006e4d7c -[AppDelegate application:didFinishLaunchingWithOptions:] + 444
19 UIKitCore 0x00000002375dbe30 <redacted> + 412
20 UIKitCore 0x00000002375dd594 <redacted> + 3352
21 UIKitCore 0x00000002375e2d20 <redacted> + 1540
22 UIKitCore 0x0000000236ea62dc <redacted> + 776
23 UIKitCore 0x0000000236eae874 <redacted> + 160
24 UIKitCore 0x0000000236ea5f60 <redacted> + 236
25 UIKitCore 0x0000000236ea6850 <redacted> + 1064
26 UIKitCore 0x0000000236ea4b9c <redacted> + 744
27 UIKitCore 0x0000000236ea4864 <redacted> + 428
28 UIKitCore 0x0000000236ea93a4 <redacted> + 220
29 UIKitCore 0x0000000236eaa188 _performActionsWithDelayForTransitionContext + 112
30 UIKitCore 0x0000000236ea925c <redacted> + 244
31 UIKitCore 0x0000000236eadf5c <redacted> + 360
32 UIKitCore 0x00000002375e1328 <redacted> + 540
33 UIKitCore 0x00000002371ddba8 <redacted> + 360
34 FrontBoardServices 0x000000020d7a49fc <redacted> + 440
35 FrontBoardServices 0x000000020d7ae40c <redacted> + 256
36 FrontBoardServices 0x000000020d7adc14 <redacted> + 64
37 libdispatch.dylib 0x0000000101dccc74 _dispatch_client_callout + 16
38 libdispatch.dylib 0x0000000101dd0840 _dispatch_block_invoke_direct + 232
39 FrontBoardServices 0x000000020d7df040 <redacted> + 40
40 FrontBoardServices 0x000000020d7decdc <redacted> + 408
41 FrontBoardServices 0x000000020d7df294 <redacted> + 52
42 CoreFoundation 0x000000020adbb018 <redacted> + 24
43 CoreFoundation 0x000000020adbaf98 <redacted> + 88
44 CoreFoundation 0x000000020adba880 <redacted> + 176
45 CoreFoundation 0x000000020adb57bc <redacted> + 1004
46 CoreFoundation 0x000000020adb50b0 CFRunLoopRunSpecific + 436
47 GraphicsServices 0x000000020cfb579c GSEventRunModal + 104
48 UIKitCore 0x00000002375e4978 UIApplicationMain + 212
49 MyApp 0x00000001006e551c main + 124
50 libdyld.dylib 0x000000020a87a8e0 <redacted> + 4
)
这个项目使用 RN 0.59.5 运行,我现在无法更新到 0.61...
【问题讨论】:
【参考方案1】:要解决此问题,请在
中打开文件yourproject/node_modules/react-native/React/Base/RCTModuleMethod.mm.
然后改正如下:
https://github.com/facebook/react-native/pull/25146/files#diff-263fc157dfce55895cdc16495b55d190
【讨论】:
我更新到 RN 0.59.10 也解决了这个问题。感谢您的回答! 我使用适用于 RN 0.11 的建议修复程序修补了RTCModuleMethod.m
,并且我的应用程序在使用补丁重新启动服务器后立即启动。这是修补后的行:NSString *unusedPattern = @"(?:__unused|__attribute__\\(\\(unused\\)\\)|__attribute__\\(\\(__unused__\\)\\))";
以上是关于更新到 Xcode 11.0 后反应本机崩溃的主要内容,如果未能解决你的问题,请参考以下文章
不变违规:不变违规:尝试从未标记为“本机”的节点获取本机标记 - 反应导航更新导致崩溃
在本机反应中找不到 Firebase crashlytics 崩溃日志?