1

I am having a problem, when I try to update an APK production file in android, it says

"Your APK's version code needs to be higher than 19."

My app is built with phonegap and I have the following code in my config.xml .

<widget xmlns     = "http://www.w3.org/ns/widgets"
    xmlns:gap = "http://phonegap.com/ns/1.0"
    id        = "com.rodriguezcab.release"
    version   = "20.0.1">

Though I have version = "20.0.1", it keeps saying "Your APK's version code needs to be higher than 19." Any solutions?

Axel Kemper
  • 8,984
  • 2
  • 29
  • 50
uttamcafedeweb
  • 87
  • 1
  • 10

2 Answers2

3

You can set this in config.xml (in the root of your cordova project). This is better than setting in 'platforms/android/AndroidManifest.xml' because platforms folder can be deleted.

In config.xml set this in the root (widget) node:

versionCode="20" 

Note this changed since previous versions (don't you love that?) when it was:

android-versionCode="20" 
mike nelson
  • 19,694
  • 13
  • 62
  • 69
  • Also note it doesn't just need to be different, it needs to be a greater number. For example I accidentally added a digit to my version number, and there's no going back. – mike nelson May 20 '16 at 08:32
  • Thanks, I needed to add the versionCode attribute to fix my rejected PhoneGap Build app. – Magnus Smith Dec 16 '16 at 12:04
2

Check platforms/android/AndroidManifest.xml

There you will see android:versionCode

This number needs to be incremented for new versions of the app. Don't get this confused with android:versionName that gets changed from the config.xml file when you do your build.

kqw
  • 19,513
  • 11
  • 64
  • 96
Dustin Simpson
  • 739
  • 5
  • 10