Where to set the version code in a Ionic/Capacitor app?

Hi,
I’m trying to upload the second version of an app on GooglePlay.

With Cordova the version was in the file config.xml.

With Capacitor in which file should I put the version code?
I thought it was package.json, but it isn’t because GooglePlay says that the app I’m trying to upload has the same version code of the previous.

Thank you very much

cld

1 Like

I don’t know if it is right but I changed in the file:
\android\app\build.gradle

the lines:

versionCode 2
versionName "1.0.2"

Now I’ve done the upload.
Isn’t there a way to change the version of the app in the Ionic environment?

cld

1 Like

Unless there’s newer guidance than this, I think you did it properly.

I am puzzled it is not taking the value from the AndroidManifet.xml

Android development switched to gradle files for configuration long time ago, if you check AndroidManifest.xml in Android Studio you can see it in two different ways “Text” and “Merged Manifest”.
If you open the “Text” way it won’t contain versionCode nor versionName as it comes from gradle, but if you check the “Merged Manifest” both values are there.

But if you want, you can remove those values from gradle and put them in the AndroidManifest.xml if you prefer the old way

2 Likes

in Android studio 4.2.1
File > Project Structure > Modules > Default Config

wait fot gradle build

generate APK

4 Likes