“Unfortunately, app has stopped” error with building React Native project on Android

我是研究僧i 提交于 2019-12-22 04:21:22

问题


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.


回答1:


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.




回答2:


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.




回答3:


When you encounter Unfortunately, app has stopped error and your app was crashed. You just need to debugging with android studio with following steps:

  1. Open command prompt in root of the you react native app directory and run react-native start
  2. Open your android studio software and click on (Shift + F10) button
  3. And finally click on logcat button (in the bottom left) and see the reason for its crash



来源:https://stackoverflow.com/questions/38815596/unfortunately-app-has-stopped-error-with-building-react-native-project-on-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!