"response-native run-android" is BUILD SUCCESSFUL, but get error type 3 Error: Activity MainActivity class does not exist

I am trying to run the application on an Android emulator, but this failed. I run react-native run-android , BUILD SUCCESSFUL, but I get error type 3 and I don’t see that it is installed on the emulator.

This part of what I get when I run "run-native run-android" in cmd:

 Installed on 1 device. BUILD SUCCESSFUL Total time: 2 mins 24.714 secs Starting the app on ***** (...\Android\sdk/platform-tools/adb -s **** shell am start -n app/.MainActivity)... Starting: Intent { cmp=app/.MainActivity } Error type 3 Error: Activity class {app/app.MainActivity} does not exist. 
+6
source share
1 answer

I spent several hours on this, and in the end I replaced the package name. The original name contained 2 dots. For instance. com.abc.test What I renamed as com.abctest Also remember to update the folder name in Android ( android/app/src/main/java/com ).

I also tried react-native init myProject --package "com.abctest" , but it doesn't seem to work anymore in recent versions of native reaction. I also tried using npm instead of yarn, and I also tried removing node-modules and caches , but it didn't work.

You may also need to run watchman watch-del-all rm -rf node_modules && npm install after

I had this project that worked very well a few weeks ago, but it seems that something has changed somewhere as well . no longer being processed correctly.

0
source

All Articles