How to solve “Your APK's version code needs to be higher than 2.” in Google Play's Developer Console?

后端 未结 16 616
半阙折子戏
半阙折子戏 2020-12-08 09:28

I\'m getting this error when uploading my Phonegap app to the Google Play Developer Console:

Your APK\'s version code needs to be higher than 2.

<
相关标签:
16条回答
  • 2020-12-08 10:02

    Had the same problem and solved it by changing the following values in the build.gradle file in the Module: app

    defaultConfig {
            applicationId //app package goes here
            minSdkVersion 10
            targetSdkVersion 21
            **versionCode 2
            versionName "1.1"**
            signingConfig //name of keystore goes here
        }
    

    This is the way Android Studio keeps track of the versioning for each app.

    Alternatively, for the noobs, you can access these settings by clicking on the settings of the app, and navigating to the Flavors tab. There you can amend certain settings such as the versionCode and the versionName.

    Hope this helps :)

    0 讨论(0)
  • 2020-12-08 10:04

    I had this issue for a while and it stumped me. I tried re-importing project. Taking the project into Android Studio from Eclipse. Everything. And what I found to work is that you have to increase the version code by 1 value. You don't have to change the version name. And before you export the apk file. Make sure you build the project at least once. So the new version code is realized.

    0 讨论(0)
  • 2020-12-08 10:04

    The solution for me was to edit config.xml and change the 'version' property.

    I tried editing my AndroidManifest.xml (every version I could find) and changed the versionCode and versionName values. Some of the AndroidManifest.xml files were overwritten with the original values, some were not overwritten. Regardless, the apk version was remaining at '1'.

    I looked in config.xml several times, but neither versionCode and versionName exist within. I finally decided to change the 'version' value in config.xml, rebuilt, and my apk now has the new, correct, version number.

    In config.xml:

    Old 'version' property: "version=0.0.1"

    New 'version' property: "version=0.0.2"

    It should be noted that I am not using Eclipse or Android Studio ... just a text editor and running a manual build. Now when I run

    aapt dump badging [apk name]

    I am seeing an updated versionCode and versionName... specifically, I see this:

    versionCode='2' versionName='0.0.2'
    

    ...and I can now upload my apk successfully to the Play store once again.

    0 讨论(0)
  • 2020-12-08 10:04

    easy way to resolve it is click on Build > Edit Flavors...

    enter image description here

    change version code and version name

    enter image description here

    click ok and done

    0 讨论(0)
提交回复
热议问题