Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native deploy to android device error 3 activity class does not exist

My app works fine on my simulator so now I am trying to put it on my phone. When I try install I get the following message

...
BUILD SUCCESSFUL
Total time: 15.578 secs

This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.html
Starting the app (/usr/local/opt/android-sdk/platform-tools/adb shell am start -n com.ethicalfishing/.MainActivity)...
Starting: Intent { cmp=com.ethicalfishing/.MainActivity }
Error type 3
Error: Activity class {com.ethicalfishing/com.ethicalfishing.MainActivity} does not exist.

I understand this error has been spoken about relating to non-react-native apps, however the solutions given were either not relevant or not helpful (or I didn't understand them)

like image 920
Adam Katz Avatar asked Jan 20 '16 12:01

Adam Katz


People also ask

How to run react native app on Android device?

Running your app on Android devices 1 Enable Debugging over USB Most Android devices can only install and run apps downloaded from Google Play, by default. ... 2 Plug in your device via USB Let's now set up an Android device to run our React Native projects. ... 3 Run your app

How to fix “error type 3 error “activity class {} does not exist”?

So in this article, we are going to discuss five different methods to Fix “Error type 3 Error: Activity class {} does not exist” in Android Studio. Step 1: Try to clean your project and delete the build directory Step 3: Now just click on the “Invalidate Caches/Restart” option from the File in the left top corner.

Why is my launcher activity not working?

Error: Activity class {LauncherActivity} does not exist. Due to this error, you must be unable to launch your launcher activity for your project if you uninstalled it on the device. So in this article, we are going to discuss that why does this error occurs and six methods that will help you to solve this error.

Can I uninstall React-Native on my Android phone?

Yes I uninstalled my react-native app on my Android phone and was met with this error. I followed @miakachammy's steps and re-ran react-native run-android and things worked as expected! I guess the launcher doesn't uninstall apps for all users when you drag it to uninstall?? ¯\_ (ツ)_/¯


Video Answer


1 Answers

I had the same problem. I found that build.gradle's applicationId and AndroidManifest.xml package were different.

build.gradle:

defaultConfig {
    applicationId "com.example.yourapp"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }

That was the problem in my case.

like image 94
YossiF Avatar answered Nov 01 '22 12:11

YossiF