Google Play says “you need to use a different package name” - why?

I have already published the com.mycompany.mygame application on google play.

Then I decided to publish its free version. I did not change the package name in eclipse because I noticed that during the "export" you have the opportunity to install the final apk as anything. So I installed it there as com.mycompany.mygameaf - pay attention to the additional "af" at the end. But then, when he tried to upload it to the market, Google said:

You need to use a different package name because "com.mycompany.mygame" is already being used by one of your other applications

So now I'm embarrassed. Is there a complaint because I am not allowed to have apk, is it a name that is also an extension of the previous application? Or does the final apk somehow know what the original name is?

What is the easiest way to resolve this?

+11
source share
6 answers

Regardless of the name of the .apk file, the name of the application content package inside it must be unique.

You can use refactor-rename to change this, but make sure that the change gets into the manifest file, proguard configuration, etc.

+1
source

Besides correcting the application name in the manifest, I also had to change the applicationId in the gradle.build application file.

  defaultConfig { applicationId "com.example.changednameofmyapp" ... } 

In addition, if you use ProGuard, do not forget to change the relevant rules in your proguard-rules.pro

Just find the old package name in the whole project and change it.

+10
source

The name of the APK doesn't matter, it's the name of the package in the AndroidManifest file that counts.

 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourcompany.yourapp" 

There can only be one application on the market with this package name, so in order to publish a free version of your ad, you will need to change the package name in the manifest file, for example. add af to the end of the package name in the manifest.

+1
source

The package name in the manifest is used to identify the application on Android and on Google Play. Therefore, different applications need different names.

The simplest workaround would be to simply create a new package without code in it and use it as the name of the application package in the manifest.

What I did to solve my problem with many applications from one code was to put the code of all the applications in the library project, and then I have several application projects that use this library. Application projects do not contain code, but only manifest and user resources.

0
source

The name of the APK file does not matter, the package name of your application is used as a unique identifier - it is located in the root element in AndroidManifest.xml

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.packagename" android:versionCode="1" android:versionName="1.0" > 

When you first create your project in Eclipse, it creates the actual package structure that corresponds to that package name for hosting the source files.

In fact, you can type the name of your package by changing this manifest value, and you can just save the folder / package structure as is - it does not need to match your actual application package name.

Alternatively, right-click your project in Eclipse, go to Android Tools, and then select Rename Application Package

After that, you can send your binary

0
source

As mentioned in other answers, development will be easier if you put all the common code and assets in a common library project, which is a dependency of your paid and free versions.

You can also play with the new Gradle build system (in Android Studio), which allows you to dynamically install things like the package name at run time. It also allows you to switch resources during build, which is extremely convenient; You may have a boolean resource that shows if the current application is a paid version. This allows you to enable / disable application features based on checking this value.

0
source

Source: https://habr.com/ru/post/948802/


All Articles