Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I try to run application on android emulator but it failed. I run react-native run-android, BUILD is SUCCESSFUL but I get error type 3 and I don't see that it installed on emulator.

This part of what I get when I run "react-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.
like image 956
y_f Avatar asked Aug 29 '16 08:08

y_f


1 Answers

Step 1 : Check whether the following files have the same package name say "com.companyName.appName":

1. package (usually line 2) in /android/app/src/main/AndroidManifest.xml
2. applicationId (usually line 90) in defaultConfig section of /android/app/build.gradle
3. Line 1 of /android/app/src/main/java/com/paysack/MainApplication.java
4. Line 1 of /android/app/src/main/java/com/paysack/MainActivity.java

Step 2 :

react-native run-android
like image 132
Arun K Avatar answered Nov 11 '22 11:11

Arun K