I created an app using Android Studio. And linked firebase as backend. While publishing on play store google informs me that there is another app with the same package name. So I go back and change the package name in and AndroidManifest file and rebuild the apk. On uploading, the apk google still says the same error with an old package name. I read somewhere that we have to change the applicationId in a build.gradle file also, but this id is used by firebase to identify the app. Hence I can't do this , so how to solve this problem?
If I'm not wrong, you should create a new application in your developer google console to upload your application with the new package name. You can't modify a package name after upload an application:
Things That Cannot Change:
The most obvious and visible of these is the “manifest package name,”
the unique name you give to your application in its
AndroidManifest.xml. The name uses a Java-language-style naming
convention, with Internet domain ownership helping to avoid name
collisions. For example, since Google owns the domain “google.com”,
the manifest package names of all of our applications should start
with “com.google.” It’s important for developers to follow this
convention in order to avoid conflicts with other developers.
Once you publish your application under its manifest package name,
this is the unique identity of the application forever more. Switching
to a different name results in an entirely new application, one that
can’t be installed as an update to the existing application.
You need to change applicationId with same package name in build.gradle file.
In android studio applicationId is considered as package name for play store. so change applicationId to change package name. It will help you.
Related
When I upload my apk on the playStore(release in alpha), I am getting this error:
Upload failed
You need to use a different package name because
[name of package] is used by a pre-installed
application. To upload a pre-installed application, please contact
Google Play Developer Support. Learn more.
However, it is my first release and no one is using this package name.
Last thing, the version code is 1531. Maybe is it due to that? FOr the first release, I have to set it to 1?
There exists other application with the same package name for sure.
You can refactor-rename your package name, and make it sure that changes reflect in a manifest file, Proguard configuration etc.
Copy your Package name in the Manifest file
<package="com.example.myapplication"> Press ctrl+shift+R enter your old package name and replace with a new one.
Your application is having the same named package, which is already used by some other app on play store.
The solution is to change the package name using refactoring. It will change your package name.
I am trying to upload an app to Google play from the Google play developer console, and it throws the following message when I try to upload an apk file: "You need to use a different package name because "com.example" is restricted." The package that my app's classes belong to is called com.example.myname.converter. What is the best way to fix the problem without messing things up?
In Android studio build gradle file change the package name.
The defaultConfig like this
applicationId "com.example.android.applicationname"
change that com.example package name
applicationId "com.yourcustomname.yourcustomname.applicationname"
then clean and rebuild project
You need to specify a valid appId. An appId like com.example is, for sure, not the correct one.
For instance, if you app is from Facebook an app id like com.facebook.app is the correct choice.
Se more information about the appId here.
For updating your app id, just go to your app build.gradle and change the field applicationId.
I want to change my applicationId to com.google.android.gm.Myapp in my app gradle or any other package like com.facebook.Myapp etc...
I would like to know what are the consequences of this changing.
Generally, I can do it and everything look work the same,
but maybe later i won't be able to upload my app to google developer console?
or maybe i will have an issues with implementation of google libs?
You will be abe to publish the APK with com.facebook and com.whatsapp
You will not be able to publish your APK to the Play Store if your package name contains com.google.
I just tested it with a simple debug APK, this was the result:
You need to use a different package name because 'com.google' is restricted.
And, yes, there is always a small chance that your package name creates a conflict with Google's libraries.
A while back I created a phonegap android app and put it on the google play store with the package name com.packagename I have since rebuilt the app in native code using android studio. Having just tried to update the app on google play and found that the package name does not match because android studio adds a company section i.e. com.companyname.packagename
I have tried refactoring but there does not seem to be a way to remove the companyname section. Is there anyway to do this? I am assuming there is no way around this in google play?
Is there anyway to do this?
Go into build.gradle and delete companyname from the applicationId values. Then, double-check your AndroidManifest.xml file and delete companyname from the package attribute in the root <manifest> element.
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?
Apart from correcting app name in the Manifest I also had to change applicationId in the app's gradle.build file.
defaultConfig {
applicationId "com.example.changednameofmyapp"
...
}
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.
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 name of the APK doesn't matter, its the package name within the AndroidManifest file that counts.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourcompany.yourapp"
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.
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 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
<?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 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
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.