I'm trying to run a project written in React Native and the app crashes:
The solution stated on this thread is irrelevant since the enableProguardInReleaseBuilds variable is already configured to false.
I've also had problems with RCT Video, solved with this thread so maybe it's related.
Thanks in advance.
Solved after debugging in Android Studio.
The error I had (java.lang.ClassCastException: android.app.Application cannot be cast to com.facebook.react.ReactApplication) was solved with greena13's answer on this thread.
When you encounter Unfortunately, app has stopped error and your app was crashed. You just need to debugging with android studio
with following steps:
- Open
command prompt
in root of the you react native app directory and run react-native start
- Open your
android studio
software and click on ▶
(Shift + F10) button
- And finally click on
logcat
button (in the bottom left) and see the reason for its crash
This can also happen if you remove a class from your project but still refer to it within AndroidManifest.xml
. Check your AndroidManifest.xml
for any references to old libraries you have stripped out from your project.