Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic 6 capacitor cannot change the app version on android

I am using Ionic 6 and capacitor in a project.

In the config.xml file I have:

    <widget xmlns="w3.org/ns/widgets"; xmlns:cdv="cordova.apache.org/ns/1.0">

When I try to change it to:

    <widget version="0.0.1" xmlns="w3.org/ns/widgets"; xmlns:cdv="cordova.apache.org/ns/1.0">

and then do ionic build android the version disappears and nothing is changed in the AndroidManifest.xml file.

When I import the apk or other into google play to test it tells me that the version already exists.

So how do I change the app version?

like image 558
zaknio55 Avatar asked Jun 14 '26 15:06

zaknio55


1 Answers

Forget about config.xml, that’s a cordova thing and not used in capacitor (other that being there for the cordova plugin compatibility).

In capacitor apps you manage the version as you would do in a native android app, that’s changing the values in the android/app/build.gradle file.

There are two fields:

  • versionCode: this is the version you have to increment every time you submit a new version to google play. It’s an integer.
  • versionName: this is the visible version that will be displayed in google play. It’s a string.
like image 127
jcesarmobile Avatar answered Jun 17 '26 19:06

jcesarmobile



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!