lisovaccaro
lisovaccaro

Reputation: 33996

Can't remove package 'com.example' from application

When I tried to upload my app to the android play store I got an error message which is "You need to use a different package name because "com.example" is restricted". So I went to eclipse and looked for packages named com.example.

These are the contents of the only two folders with packages:

/ src
    myapp.mainclass
/ gen
    com.example.myapp *
    myapp.mainclass

*com.example.myapp seems to be the reason I'm getting the error message, it's identical to myapp.mainclass. However I cannot delete it or re factor it, every time I remove it it's auto-generated again so there is no way I can upload the app to the Play Store, since com.example is impossible to remove.

Anyone encountered this issue or has any ideas on how to upload the app?

Upvotes: 3

Views: 12874

Answers (6)

양기창
양기창

Reputation: 169

you should change your applicationID(usually called "package address") you can change com.example to your own address by following steps.

  1. in toolbar, click 'file' tab
  2. choose 'project structure'.
  3. 'app' tabs in 'modules' category -> 'Default Config' tab
  4. change 'application Id'.
  5. rebuild your project.

then, you can not see "com.example..." anymore.

Upvotes: 0

James Finn
James Finn

Reputation: 386

A more comprehensive way to rename the package is to:

Right click the project name -> Android Tools -> Rename Application Package -> and then type in your new package name.

It seems to update the entire project in the one go here.

Upvotes: 2

Mohammad Ersan
Mohammad Ersan

Reputation: 12444

After renaming your package in src folder, rename it also in the AndroidManifest.xml with the same name.

Upvotes: 11

Puneet
Puneet

Reputation: 611

Edit Package name and then in the AndroidManifest.xml with the same package name, clean your project, rebuild, now i hope this will work.

Upvotes: 1

itsrajesh4uguys
itsrajesh4uguys

Reputation: 4638

delete the gen folder. and clean the project. your gen folder will get create automatically. At the same time you should change the package name in Manifest file. it should be which you want.

Upvotes: 0

android2013
android2013

Reputation: 425

You can create a new project in eclipse using your new package name and after that copy past your java file and any res files into new project.

Upvotes: 0

Related Questions