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

55,060

Solution 1

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

Solution 2

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

Solution 3

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"

Solution 4

  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.

Solution 5

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.

Share:
55,060

Related videos on Youtube

Mike
Author by

Mike

Updated on June 30, 2021

Comments

  • Mike
    Mike about 3 years

    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.
    
  • Pratik Butani
    Pratik Butani over 9 years
    What about packages in src folder.
  • stinepike
    stinepike over 9 years
    @PratikButani that will not create a problem .. the application package and the src package is totally different thing.. you can use that as src package
  • payne
    payne about 5 years
    This was a nice solution. However, if you are using google-services.json, read this.