【发布时间】:2019-06-01 14:25:11
【问题描述】:
我遇到了一个问题,即我的 react 本机应用程序打开然后立即关闭。我运行 react-native run-ios,Metro Bundler 加载到 100%,然后应用程序崩溃。我到处搜索,找不到问题所在!
我在模拟器系统日志中发现了这个:
Jan 6 20:01:44 Mac-mini MyApp[31448]: assertion failed: 18C54 16B91: libxpc.dylib + 79599 [F7D4B188-D5C2-3E5E-BB76-BC7C6A368166]: 0x7d
Jan 6 20:01:46 Mac-mini com.apple.CoreSimulator.SimDevice.9ABCA7C0-8781-4151-B5C7-ED03FE429BC1[26939] (UIKitApplication:com.myApp.app[0xaf59][26962][31448]): Service exited due to SIGSEGV | sent by exc handler[31448]
虽然构建成功,但我可以看到以下内容,这会导致问题吗?
The following commands produced analyzer issues:
Analyze /Users/maxy/Desktop/myApp/node_modules/react-native/React/Base/RCTModuleMethod.mm normal x86_64
Analyze /Users/maxy/Desktop/myApp/node_modules/react-native/Libraries/Network/RCTNetInfo.m normal x86_64
(2 个带有分析器问题的命令)
我已尝试删除 iOS/build 文件。从 Xcode 清理项目和构建。调试和发布版本。
当我从 Xcode 运行时,它会在输出中显示以下内容:
2019-01-06 20:08:57.083678+0000 myApp[31468:269858] - <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2019-01-06 20:08:57.198519+0000 myApp[31468:269858] 5.15.0 - [Firebase/Analytics][I-ACS023007] Analytics v.50400000 started
2019-01-06 20:08:57.200271+0000 myApp[31468:269858] 5.15.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled
2019-01-06 20:08:57.225194+0000 myApp[31468:269858] 5.15.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
2019-01-06 20:08:57.252 [info][tid:main][RCTCxxBridge.mm:216] Initializing <RCTCxxBridge: 0x600002578ff0> (parent: <RCTBridge: 0x600003168620>, executor: (null))
2019-01-06 20:08:57.254831+0000 myApp[31468:269808] Initializing <RCTCxxBridge: 0x600002578ff0> (parent: <RCTBridge: 0x600003168620>, executor: (null))
2019-01-06 20:08:57.447 [info][tid:main][RCTRootView.m:293] Running application myApp ({
initialProps = {
};
rootTag = 1;
})
2019-01-06 20:08:57.447252+0000 myApp[31468:269808] Running application myApp ({
initialProps = {
};
rootTag = 1;
})
2019-01-06 20:08:57.480500+0000 myApp[31468:269808] -[RNFirebaseMessaging init] [Line 34] Setting up RNFirebaseMessaging instance
2019-01-06 20:08:57.480835+0000 myApp[31468:269808] -[RNFirebaseAuth init]_block_invoke [Line 42] RNFirebaseAuth:instance-created
2019-01-06 20:08:57.480973+0000 myApp[31468:269808] -[RNFirebaseAuth init] [Line 45] RNFirebaseAuth:instance-initialized
2019-01-06 20:08:57.481224+0000 myApp[31468:269808] -[RNFirebase init] [Line 12] Setting up RNFirebase instance
2019-01-06 20:08:57.481635+0000 myApp[31468:269808] -[RNFirebaseNotifications init] [Line 45] Setting up RNFirebaseNotifications instance
2019-01-06 20:08:57.496791+0000 myApp[31468:269808] -[RNFirebaseMessaging messaging:didReceiveRegistrationToken:] [Line 87] Received new FCM token: fXHq98QGnyw:APA91bH7b66ywMfcEVB6yPSUG_p1pkFugA4PY1EtmkJaG_43JtNkPnAG-MPJ6cP2RsknEWwGqUqzfIhOCfocWM_NSQfAQVhTY1JRTwenzn-tczYhUK90d4P7nynu1xAD81kur39mVG2E
2019-01-06 20:08:57.528077+0000 myApp[31468:269869] [] nw_socket_handle_socket_event [C5.1:1] Socket SO_ERROR [61: Connection refused]
2019-01-06 20:08:57.547389+0000 myApp[31468:269869] [] nw_socket_handle_socket_event [C5.2:1] Socket SO_ERROR [61: Connection refused]
2019-01-06 20:08:57.549096+0000 myApp[31468:269887] [] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-01-06 20:08:57.626521+0000 myApp[31468:269877] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7fc74e606a40] get output frames failed, state 8196
2019-01-06 20:08:57.626723+0000 myApp[31468:269877] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7fc74e606a40] get output frames failed, state 8196
2019-01-06 20:08:57.627564+0000 myApp[31468:269877] TIC Read Status [1:0x0]: 1:57
2019-01-06 20:08:57.627978+0000 myApp[31468:269877] TIC Read Status [1:0x0]: 1:57
还有什么我可以检查的/还有更多日志吗? 当我做 react-native run-android 时,一切都没有问题。
提前谢谢你。
【问题讨论】:
-
检查您的所有
console.log语句,因为有时记录大对象可能会导致崩溃。 -
感谢您的评论。我评论了我所有的 console.log 语句,但仍然没有运气。
标签: react-native