John Brunner
John Brunner

Reputation: 2872

Ionic/Cordova does not update versionCode for Android

When I change the version in my config.xml, the internal Android versionCode ist not updated to the new value. Android Console is always showing an error because "I already have an App with that versionCode on the Play Store".

I've also tried the following things in config.xml

<widget ... version="1.1.4" versionCode="10104" android-versionCode="10104" ...>
<platform name="android">
  <preference name="android-manifest/@android:versionCode" value="114" />
</platform>

Doesn't work. The versionCode stays the same.

UDPATE: I deleted the Android platform and re-added it, now it works!

Upvotes: 5

Views: 2320

Answers (2)

sioesi
sioesi

Reputation: 517

I find that when you run run android ionic or ionic build android generates the version of the code in the same as the version, is not a good practice to change this code, but if you want to change: you must change only the proyect/platform/android/AndroidManifest.xml,

I let you link that may interest you. Here!

Upvotes: 0

Ujjwal kaushik
Ujjwal kaushik

Reputation: 1686

Changing VersionCode manually is not a good idea , You should only change version in config.xml,after that run

ionic build --release android

It will automatically update your AndroidManifest.xml.Make sure if version code is updated before publishing your app to play store.

Thanks

Upvotes: 2

Related Questions