"com.example is restricted" when uploading APK to Play Store
Asked Answered
P

6

35

I am trying to upload my finished android app to the android market and I am getting this error:

You need to use a different package name because "com.example" is restricted.
Presurmise answered 1/7, 2013 at 3:52 Comment(0)
F
20

The error message is telling it all. You need to use a package name of your own. The package name is the identitiy of the application.

To rename the package name, In eclipse right click on the project in project explorer. Then Android Tools > rename Aplication Package name. Then enter the new package name.

Also make sure that you are trying to upload a release build

Foundry answered 1/7, 2013 at 3:55 Comment(2)
What about packages in src folder.Broads
@PratikButani that will not create a problem .. the application package and the src package is totally different thing.. you can use that as src packageFoundry
W
69

In Android Studio after renaming Package then go "build.gradle (Module:App)

defaultConfig {
       applicationId "com.example.android.abc"
       minSdkVersion 9
      targetSdkVersion 22
      versionCode 1
    versionName "1.0"
}

change the line

 applicationId "com.example.android.abc"

to

applicationId "com.tanxe.android.abc"

relpace "tanxe" with the word you want or your Organization name i.e.
your new package name and rebuild the project

Wraf answered 31/5, 2015 at 15:12 Comment(0)
S
23

The best way to solve this is by going to the AndroidManifest.xml: package="com.example.android.yts"

Cursor on example

press

Shift+f6

change Package name eg. example to boss Click on refactor now `"com.boss.android.yts"``

2nd thing

open build.gradle (module:app) change applicationId "com.example.android.yts" to "com.boss.android.yts"

Salami answered 19/9, 2018 at 6:30 Comment(1)
This was a nice solution. However, if you are using google-services.json, read this.Cottingham
F
20

The error message is telling it all. You need to use a package name of your own. The package name is the identitiy of the application.

To rename the package name, In eclipse right click on the project in project explorer. Then Android Tools > rename Aplication Package name. Then enter the new package name.

Also make sure that you are trying to upload a release build

Foundry answered 1/7, 2013 at 3:55 Comment(2)
What about packages in src folder.Broads
@PratikButani that will not create a problem .. the application package and the src package is totally different thing.. you can use that as src packageFoundry
A
3
  1. Double-tap **package** from AndroidManifest.xml, refactor-> rename.

  2. Go to build.gradle and change applicationId under defaultConfig.

  3. If you have google-services.json, go to google-services.json and rename package_name in two places.

That should work.

Aitch answered 29/6, 2021 at 17:5 Comment(0)
P
2

Yes, com.example is the default package name for Android applications and is, as such, just a placeholder. You should replace it by a unique package name before uploading it to the Google Play Store. It doesn't particularly matter what it is, but it should relate to your application, cannot match any existing package name (so picking someone else's package name like com.android is not a good idea), and cannot be changed after publishing.

Pirogue answered 1/7, 2013 at 3:55 Comment(0)
W
-2

Write something else than the com.example

for ex: com.gg.s etc will do(make that onj your name/firm name)

Winstonwinstonn answered 1/7, 2013 at 3:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.