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.
<
For my Cordova built app, the Gradle file didnt have the static code. It was picked using Android Manifest like this -
defaultConfig {
versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode") + "0")
applicationId privateHelpers.extractStringFromManifest("package")
if (cdvMinSdkVersion != null) {
minSdkVersion cdvMinSdkVersion
}
}
I tried changing the version code in the manifest file, but no luck.
Not a good thing to do, but out of hurry I did this -
defaultConfig {
versionCode cdvVersionCode ?: (Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode") + "0") + 2)
applicationId privateHelpers.extractStringFromManifest("package")
if (cdvMinSdkVersion != null) {
minSdkVersion cdvMinSdkVersion
}
}
Note: For Cordova built apps, you need to make changes in the Gradle Scripts > File which says - "build.gradle (Module:android)"