I have made an app and it is my very first app so when I started coding, I left the package name as com.example.stuff and now when I try to upload to the play store it wont let me due to the package name. I have tried refactor-> rename the package name and changed it in the AndroidManifst.xml then I tried to upload again. I am once again left with the same message time after time.
I appreciate any help and thanks in advance. :)
Step by Step Implementation Step 2: Now click on the setting gear icon and deselect Compact Middle Packages. Step 3: Now the packages folder is broken into parts as shown in the below image. Step 4: Now right-click on the first package name (com) and Refactor > Rename.
In the Pop-up dialog, click on Rename Package instead of Rename Directory. Enter the new name and hit Refactor. Click Do Refactor in the bottom. Allow a minute to let Android Studio update all changes.
No, every app should have a unique package name. If you install an app with a package name which is already used in another installed app, then it will replace it.
First click once on your package and then click setting icon on Android Studio.
Close/Unselect Compact Empty Middle Packages
Then, right click your package and rename it.
Thats all.
In projects that use the Gradle build system, what you want to change is the applicationId
in the build.gradle file. The build system uses this value to override anything specified by hand in the manifest file when it does the manifest merge and build.
For example, your module's build.gradle file looks something like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
// CHANGE THE APPLICATION ID BELOW
applicationId "com.example.fred.myapplication"
minSdkVersion 10
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
}
applicationId
is the name the build system uses for the property that eventually gets written to the package
attribute of the manifest
tag in the manifest file. It was renamed to prevent confusion with the Java package name (which you have also tried to modify), which has nothing to do with it.
It can be done very easily in one step. You don't have to touch AndroidManifest. Instead do the following:
Another good method is: First create a new package with the desired name by right clicking on the java folder -> new -> package.
Then, select and drag all your classes to the new package. Android Studio will refactor the package name everywhere.
Finally, delete the old package.
or Look into this post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With