3

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?

Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125
lisovaccaro
  • 32,502
  • 98
  • 258
  • 410
  • i thinkyour main package name contains com.exaple..So, please check it and if there rename it and clean your project.. – Mehul Ranpara Jan 02 '13 at 07:06
  • delete the gen folder. and clean the project. your gen folder will get create automatically. – itsrajesh4uguys Jan 02 '13 at 07:14
  • This is such a nice little trap for people trying to make their first app. Just when you go to publish you get hit with this ridiculous design. Apps built off of the examples should be publishable without having to go around tinkering with stuff you don't even understand yet. – user2445507 Apr 14 '19 at 01:12

6 Answers6

11

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

Mohammad Ersan
  • 12,304
  • 8
  • 54
  • 77
  • Thanks. This fixed the issue. I renamed the package with "Update references checked", then renamed it on the AndroidManifest and it prompted to "Update the launch configurations" clicking on OK regenerated the /gen folder correctly. – lisovaccaro Jan 02 '13 at 07:41
  • How to cangh the name n src? – user2073729 Apr 19 '13 at 14:31
2

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.

James Finn
  • 366
  • 2
  • 12
1

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

Puneet
  • 611
  • 6
  • 22
0

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.

android2013
  • 415
  • 2
  • 5
0

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.

itsrajesh4uguys
  • 4,610
  • 3
  • 20
  • 31
0

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 -> 'Flavors' tab
  4. change 'application Id'.
  5. rebuild your project.

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

양기창
  • 169
  • 1
  • 1
  • 3