I've got an issue where my react native app opens and then closes straight away. I run react-native run-ios, Metro Bundler loads to 100% then app crashes. I've searched everywhere and cannot find out what the issue is!
I found this in the simulator system logs:
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]
Although the build succeeds I can see the below, would this cause issues?
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 commands with analyzer issues)
I've tried deleting the iOS/build file. Cleaning project and building from Xcode. Debug and release version.
When I run from Xcode it gives me the below in the output:
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
Is there anything more I can check / any more logs? when I do react-native run-android everything is working with no issues.
Thank you in advance.
console.logstatements as sometimes logging a large object can cause crashes.