Android Studio gets package name wrong when running .apk
I tried to restart Android Studio but the problem still existed.
Then the solution works with me.
- Remove the directory
~/.gradle/caches/
. It's OK to do this while Android Studio is opened. (Refer pm installing wrong package name) - Press "Sync project with Gradle files" icon on Android Studio
- Run the project and the remote path will be correct.
I Did all mentioned things but no effect. Then I found something in build.gradle file and changed it as per my new package. It worked for me.
defaultConfig {
applicationId "com.*****.newPackageId"
minSdkVersion 11
targetSdkVersion 20
}
Here is how I solved it. Very simple.
Click the 'Sync Project with Gradle Files' button at the top of the window.
Look for this button if you're using newer version of Android Studio: