I have an app uploaded to the Google play-store , which I have been updating several times, without problems. While I was creating the update from the existing code with Eclipse , every time I tried my application on my mobile, it deleted the previous one and installed the new one. And when I uploaded it to the play-store , it did the same with all the people who had the app installed. so far so good.
The problem comes now:
I have recently installed the Android Studio , to create an update of my app, but this time I want to rewrite all the code from scratch. And I have realized that every time I try the application while I am creating it, it is installed correctly, but it does not delete the one that is installed that I had already downloaded from the play-store . With which it does not replace the previous application but leaves the two applications installed.
How can I make my app that was rebuilt from scratch with minor modifications replace the old one?
Yes, this is perfectly in line with the Google Play app update process.
Google-play determines that a request is an update based on two criteria:
1 - The package name of the application.
2 - Your version code
To be considered an update, your new app must have exactly the same name as the old package ("com.example.myapp"), and its name
android:versionCode
must be greater, in its AndroidManifest.xml file. Of course, the APK must be signed with your account's private key, just like any app published under your account.The problem is that you defined your application with another unique identifier, in short with a different package name.
An app update must be created with the same app package and signed with the same keystore.
The application package in the case of Android Studio can also be defined in the file in
build.gradle
addition to theAndroidManifest.xml
, it is important to know that the configuration defined in thebuild.gradle
overrides that of theAndroidManifest.xml
.To change your package name settings, you don't need to go into
module settings
, just do it in yourAndroidManifest.xml
or yourbuild.gradle
, obviously the directories would be renamed, which you have to do by refactoring or changing manually.Configuration example
build.gradle
:Configuration example
AndroidManifest.xml
(You can also use a .json file) :It
versionCode
does not influence the installation of a different application, you just have to take care that each new version has a consecutive integer value.Unfortunately it will not be possible to install an update of the application since the package is unique and you can only update the application that has the same package, in fact the installation url of an application is defined by the package as id:
https://play.google.com/store/apps/details?id=com.mydomain.myapplication