React Native app crashing without any error log. No output on "react-native log-android
" terminal, no red screen with error, Android emulator just crashes. Tried running with Expo, again crashes with no error
Happens when working with TextInput
. I have some ideas how I can fix the code, but want to understand why is app crashing without error log and making debugging much more difficult?
How do I know if an app crashes in react native? Connect your device to your computer. Run adb devices to check out if your device is detected. Now run adb logcat : This command will output all logs (debug and error levels) coming from your Android Device.
Crashlytics helps you to collect analytics and details about crashes and errors that occur in your app. It does this through three aspects: Logs: Log events in your app to be sent with the crash report for context if your app crashes.
Note that as of React Native 0.29 and later, you can get logs without running the debugger. Just run react-native log-ios or react-native log-android on the command line inside your project folder. And when you open the Remote JS Debugging, you have to press option+command+i and check the console.
my bug was fixed by deleting the build folder(inside android/app) and running
npx react-native run-android
Run adb logcat
You can find your app name in your package.json, under the name field.
Also when looking for errors specifically dealing with react native, try running
adb logcat | grep 'redbox'
This way you don't have to scan the entire logfile.
Or try the method shown in this article:
Run
adb logcat *:S ReactNative:V ReactNativeJS:V
in a terminal to see your Android app's logs.
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