52

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. :)

2
  • 3
    Yes, but none of the answers there worked for me. Sometimes I think it's good to post a question a second time because people come with newer solutions. Or what is the normal practice here to ask people "Hey, I now in thread xyz the quetion was already askes. But the answers didn't help me. So may someone have a modern solution for this problem?"? Commented Nov 19, 2015 at 8:17
  • The problem with this issue is that, IMO, all of the answers given are partial solutions. I have never seen an answer to this question that changes the package name everywhere. Commented Dec 26, 2015 at 22:52

3 Answers 3

76

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.

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

Also, this video explain how solve your problem http://www.youtube.com/watch?v=RNcrzOMugn8
Btw dont forget rebuild your application after make your changes. Build>Rebuild App
Just want to add, that is need to go to build.gradle (of the module) and change ApplicationID to
This is the perfect, accurate, appropriate, standard, best, amazing and proper way. Dot.
54

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.

1 Comment

by doing this the package name in did not change anywhere else (package and manifest)
28

It can be done very easily in one step. You don't have to touch AndroidManifest. Instead do the following:

  1. right click on the root folder of your project.
  2. Click "Open Module Setting".
  3. Go to the Flavours tab.
  4. Change the applicationID to whatever package name you want. Press OK.

11 Comments

Didn't work: Build APK did NOT observe new package name.
I "lied". While the computer path still has old package name, APK somehow has new package name. Sorry.
@DSlomer64 No worries.
That's the only solution which worked for me. Other approache were error-prone. Also the ones here: stackoverflow.com/questions/16804093/…
But that didn't change the package names throughout the project
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.