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.
<
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 :)
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.
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.
easy way to resolve it is click on Build > Edit Flavors...
change version code and version name
click ok and done