Update an app already uploaded to the play-store

9

I have an app uploaded to the play-store of Google , which I have been updating several times, without problems. While I was creating the update from the existing code with the Eclipse , every time I tried my application on my mobile, it erased the previous one and the new one was installed. And when I uploaded it to the play-store , I did the same with all the people who had the app installed. So far so good.

The problem is now:

I recently installed the Adroid Studio , to create an update to my app, but this time I want to rewrite all the code from scratch. And I've noticed that every time I try the application while I'm creating it, it is installed correctly, but it does not erase the installed one that I had already downloaded from the play-store . With which it does not replace the previous application but it leaves the two applications installed.

How can I make my re-created application with small modifications replace the previous one?

    
asked by Natlum 26.10.2016 в 12:17
source

2 answers

9

Yes, this is perfectly in line with the update process of the Google Play application.

Google-play determines that a request is an update based on two criteria:

1 - The name of the application package.

2 - Your version code

To be considered an update, your new application must have exactly the same name as the previous package ("com.example.myapp"), and its android:versionCode must be greater, in your AndroidManifest.xml file. Of course, the APK must be signed with the private key of your account, just like any application published under your account.

    
answered by 26.10.2016 / 12:31
source
7
  

If you create a new application and install it from the PlayStore,   it replaces the previous one.

The problem is that you defined your application with another unique identifier, in a few words with a different package name.

An application update must be created with the same application package and signed with the same Keystore.

The application package in the case of Android Studio can also be defined in the file build.gradle in addition to AndroidManifest.xml , it is important to know that the configuration defined in build.gradle overwrites the AndroidManifest.xml .

To change the configuration of your package name, you do not need to enter module settings , simply perform it in your AndroidManifest.xml or your build.gradle , obviously the directories would change their name, which you have to perform refactoring or changing manually .

Example configuration build.gradle :

android {
  ...
  defaultConfig {
     applicationId "com.mydomain.myapp"
    versionCode 2
    versionName "1.1"
     ...
  }

}

Example configuration AndroidManifest.xml (You can also use a .json file):

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mydomain.myapp"
    android:versionCode="2"
    android:versionName="1.1" >

The versionCode does not affect the installation of a different application, you just have to take care of a consecutive whole value every new version.

Unfortunately you can not install an application update 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:

link

    
answered by 26.10.2016 в 13:22