Setting Android version code in Ionic 2 / Cordova

You can specify a custom version-code in config.xml. Add the following property to the <widget> element (the root element): android-versionCode="101003".

This is an example of a full <widget> tag with more properties that are probably useful:

<widget android-versionCode="100" id="your.bundle.id" ios-CFBundleVersion="1.0.0" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  • version is the version displayed in the app stores, can stay the same across different builds
  • android-versionCode this is used by Google-Play to differentiate between your builds, must always be higher than the previous one
  • CFBundleVersion is used by iTunesConnect to differentiate your builds, must always be higher than the previous one
  • id is where you define the bundle identifier of your app, this must always stay the same

If you compile your project with Android Studio, you can change it in the App-> Manifests-> AndroidManifest.xml folder

screenshot