2

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.

2
  • check all your console.log statements as sometimes logging a large object can cause crashes. Commented Jan 6, 2019 at 20:42
  • Thanks for the comment. I commented all of my console.log statements but still no luck. Commented Jan 8, 2019 at 12:03

1 Answer 1

1

1: If you have pod installed, Make sure you check all your libraries.You likely have some issue with an installed external library. and make sure you run pod install and delete node_modules folder and then run npm install again (close the packager too)

2: You can also use sentry or any other crash reporting library to detect crashes, It will give you the exact line number.(Make sure you install the react-native version).

3: Sometimes the crash reporting libraries won't work, the reason can be that the crash occurs before the js bundle is loaded and because of that, the library is not yet initialised and it can't detect the crash. If so you can install a native crash reporting library, You can use fabric for that, or even bugsnag.

4: Even if these 3 steps don't work, Sometimes due to some problem in certificates the app can crash on startup, and sometimes the app can work for few days and then crash suddenly, If this behaviour occurs. Make sure your certificates are generated correctly.

These are the few scenarios where this kind of crash occurs. Usually its the first one

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for the information. I'm thinking no.1 is correct since I had never previously installed pods etc or done anything with xcode and I ran a few updates multiple times and linked different libraries which I think was wrong after re-reading some of the docs. I'm currently starting from scratch and adding each package individually and testing after to make sure. I will update you once done. Thanks again.
Happy to help. :) let me know if something happens, you can also install a library one by one and also test one by one, with that you can see which one is creating some problems easily.
Just marked your answer as correct. I re-installed everything and now it is working as expected. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.