I have already published an app called com.mycompany.mygame on google play.
I then decided to publish an ad free version of it. I did not change the package name in eclipse because I noticed that in the "export" process you have the opportunity to have the final apk set as anything you like. So I set it there as com.mycompany.mygameaf - note the additional "af" on the end. But then when tried to upload it to the market, google said:
You need to use a different package name because "com.mycompany.mygame" is already used by one of your other applications
So now I'm confused. Is the complaint because I'm not allowed to have an apk that is a name which is and extension of a previous app? Or does the final apk somehow have knowledge of what the original name was?
What is the easiest way to resolve this?
The package name in the manifest is used to identify the application within Android and within Google Play. So different apps need different names.
The easiest workaround might be to just create a new package, with no code in it, and use that as the app's package name in the manifest.
What I've done to solve my many-apps-from-one-codebase problem is put all the apps' code in a library project, and then I have several app projects that use that library. The app projects contain no code, just a manifest and custom resources.
Regardless of the name of the .apk file, the package name of the Application contents inside it must be unique.
You can use refactor-rename to change this, though make sure that the change penetrates to the manifest file, proguard configuration, etc.
The filename of the APK is irrelevant, the package name of your app is used as a unique identifier - it is in the root element in the AndroidManifest.xml
When you initially create your project in Eclipse it creates an actual package structure which matches this package name for you to put your source files in.
You can actually chnage your package name by modifiying this manifest value and you can just keep 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 you do this you should be able to submit your binary
As mentioned in other answers, you're development would be simpler if you put all the shared code and assets a common library project that is a dependency of your paid and free versions.
You may also wish to play with the new Gradle build system (in Android Studio) which allows you to dynamically set things like the package name at runtime. It also allows you to switch resources during build time, which is extremely convenient; You could have a boolean resource that represents whether the current app is the paid version. This allows you to enable/disable app features based on a check to that value.
The name of the APK doesn't matter, its the package name within the AndroidManifest file that counts.
There can only be one app on the market with that package name so in order to publish your ad free version you would have to change the package name in the manifest file, e.g. add the af onto the end of the package name within your manifest.
Apart from correcting app name in the Manifest I also had to change
applicationId
in the app's gradle.build file.Also, if you're using ProGuard, do not forget to change appropriate rules in your proguard-rules.pro
Just search the old package name in the whole project and change it.