React Native app crashes without any error log
Solution 1:
my bug was fixed by deleting the build folder(inside android/app) and running
npx react-native run-android
Solution 2:
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.
Solution 3:
I was running an Android Project on my Linux PC, then I have made some changes on it in a MacOS PC, and when I git pulled de project back to Linux I faced that crashes
inside the android
folder, just run:
./gradlew clean
and then try to run it again.
Solution 4:
In case react native app crashes without an error message checking the problem in Android Studio's Logcat works perfect. But don't forget to create a filter with your package name.
- Open Android Studio
- Open Logcat
- Click on "Edit Filter Configuration" in the right top of the logcat screen
- Fill in your criteria (don't forget package name)
- Run you react native project on an android device or emulator