I\'ve created the project using the following command.
react-native init Awesome_Project
I\'ve started the packager using the following com
Huawei p20 lite. Tried to install app from downloads which would not install. Went back to run to install in android studio and got the error error 3 mainactivity does not exist. Had to delete user 'private space ' to solve the problem
I had changed my application id from com.appName
to com.companyName.appName
, and I had made this update in android>app>build.gradle
:
defaultConfig {
applicationId "com.companyName.appName" // was previously "com.appName"
}
I also changed my file structure from android>app>src>main>java>com>appName
to android>app>src>main>java>com>companyName>appName
. This is when I got the error.
To fix the error, I simply did a project wide search (CMD-SHIFT-F
in Atom) for com.appName
, and replaced them all with com.companyName.appName
. Problem solved!
This happened to me after changing my project package name.
I tried some of the other answers here but nothing worked until I manually deleted the android/build
directory, and re-ran react-native run-android
forcing the app to be rebuilt from src.
Turns out the build was cached including references to the old package name.
Make sure android/app/build.gradle
defaultConfig {
applicationId "WHATEVER_THIS_IS"
}
needs to match android/app/src/main/java/com/app_name/MainActivity.java
line one:
package WHATEVER_THIS_IS;
needs to match android/app/src/main/java/com/app_name/MainApplication.java
line one:
package WHATEVER_THIS_IS;
needs to match android/app/src/main/AndroidManifest.xml
line one:
package="WHATEVER_THIS_IS">
adb uninstall packageName Worked for me. for eg: adb uninstall com.abc
I uninstalled the app from my device and was not able to see it in my Settings > Apps at all. The error finally went away after I fully uninstalled the app by doing:
adb uninstall com.appname