I'm starting with React Native, everything works fine in the iOS simulator. I decide to try it on a device.
The app launches, I can play with it, I close/reopen it around 4 or 5 times, and then somewhat randomly the app crashes on Launch Screen (the one with "Powered By React Native"). It just shows the screen, and the app crashes to the iPhone home screen.
Any idea how I can further debug that?
Edit: I added Bugsnag in my AppDelegate.m, but bugsnag doesn't detect anything when the app crashes.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
[BugsnagReactNative start];
// Rest of code
}
Apps on Android can crash because of low storage space, too many apps running simultaneously, a weak internet connection, or not having the proper app updates installed.
I came across this issue today. Read a few SO posts and saw one guy mentioned if your app launches and hangs on the splash screen and then crashes with no error it probably has something to one of your npm dependencies.
After digging deeper i saw the react packager was throwing the error
This error is caused by a @providesModule declaration with the same name across two different files.
To fix
check / clean up dependencies(check for same name declerations)
rm -rf node_modules
rm -rf $TMPDIR/react-*
npm i
This can caused by many issues it seems. Recently this happened to me and I had to search a bit to find out the exact reason. I'll save you guys the trouble by sharing few places I read - https://github.com/facebook/react-native/issues/14500#issuecomment-348063910 - https://github.com/facebook/react-native/issues/17276#issuecomment-357538208
In my case it was a library issue which I have not linked properly.
-https://github.com/ivpusic/react-native-image-crop-picker/issues/204
So yeah! my point is, it's something we have done or not done. Bit more research would help!!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With