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

后端 未结 16 630
半阙折子戏
半阙折子戏 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 09:40

    Increase the version code to 3 by changing versionCode in your AndroidManifest.xml:

    <android xmlns:android="http://schemas.android.com/apk/res/android">
            <tool-api-level>10</tool-api-level>
            <manifest android:versionCode="3" android:versionName="0.1.1" android:installLocation="preferExternal"/>
            <uses-sdk android:maxSdkVersion="10" android:minSdkVersion="7" android:targetSdkVersion="10"/>
    </android>
    
    0 讨论(0)
  • 2020-12-08 09:40

    People at android and your users need to just keep track of all the updates so it's required for you to mention the version by updating versionCode and versionName

    Here is how to fix the problem:

    EARLIER

    defaultConfig {
        applicationId "com.example.random.projectname"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    

    NOW

    defaultConfig {
        applicationId "com.example.random.projectname"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 2
        versionName "1.0.1"
    }
    

    Remember

    • versionName is what is displayed at bottom of Long Description for the app's user
    • While versionCode is for developer's and google's need and has to be incremented by one always for every new versionName even when you change versionName from v1.0.5 to v1.0.6
    0 讨论(0)
  • 2020-12-08 09:42

    Use aapt to verify your APK version:

    aapt dump badging myapp.apk
    

    It will tell you to increase the versionCode in AndroidManifest.xml, e.g.

      <manifest android:versionCode="3">
    
    0 讨论(0)
  • 2020-12-08 09:47
    appt dump badging myapp.apk
    

    This command works in checking the built apk version. but to and old trick fixed this problem, even if I incremented the version. Try to clean the workspace and build again.

    0 讨论(0)
  • 2020-12-08 09:49

    When you are ready to deploy your app to an APK, in JDeveloper go to Application -> Deploy -> New Deployment Profile. Set Profile Type to ADF Mobile for Android, pick a name and click OK. In the next window pick the Android options and change the Version Code. That's what Google Play didn't like (because you already had an app with the same version code). That's how I resolved this issue.

    0 讨论(0)
  • 2020-12-08 09:52

    In Android studio I was only able to get this to work by changing the versionCode in the app file.

    android {
        compileSdkVersion 19
        buildToolsVersion '19.1.0'
        defaultConfig {
            applicationId 'xxxxxxxxxxxxxxx'
            minSdkVersion 14
            targetSdkVersion 19
            versionCode 3
            versionName '1.1'
        }
        buildTypes {
            release {
                runProguard false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        productFlavors {
        }
    }
    
    0 讨论(0)
提交回复
热议问题