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.
<
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>
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
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">
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.
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.
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 {
}
}