Search code examples
javaandroidgoogle-playgoogle-play-servicesapk

Change code version of an application on Google Play Console


I am trying to upload an .apk on GooglePlayConsole. This .apk is generated with Expo (and coded in React-Native).

The first time, I generated it by default, and it got the codeVersion: 1 (which is basically a batch of permissions). However, my .apk has been unauthorized due to "No need about this permissions".

So I rebuilt the .apk with another codeVersion (without any permissions), which should be approuved. However, when I am trying to upload the .apk on GooglePlayConsole (where my previous has been unapprouved), I got an error message :

You should use another code version for your APK or Andoid App Bundle. The code 1 is already use by another APK or Android App Bundle.

But I do not know where (or if) I can change the codeVersion of an application on GooglePlayConsole.

I thought about deleting the app, but this is not possible once it has been rejected.

There is a screenshot : https://puu.sh/CFAQS/ff43b0ccb8.png

Thanks.


Solution

  • Change the versionCode in gradle app:

    android {
        compileSdkVersion 28
        defaultConfig {
            applicationId "applicationId"
            minSdkVersion 21
            targetSdkVersion 28
            versionCode 1 ----- Here you should change your versionCode
            versionName "1.0"
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
    }