I am currently using Cordova 3.4.0 and the CLI to build my project to target android using the command:
cordova build android
OR
cordova build android --release
My config.xml has the following specified:
<widget id="com.example.myapp" version="0.0.3" versionCode="2" ... > </widget>
The resulting AndroidManifest.xml in myapp/platforms/android does not get updated with the version and version code specified in config.xml. It stays as the default:
<manifest android:versionCode="1" android:versionName="1.0" ... </manifest>
Is this a bug? Or is there some other way I should specify the versionCode and versionName for Android in the config.xml? Even maybe, is there a hook I can use to update AndroidManifest.xml with the correct version before build?
I would rather not have to update this manually each time I want it to change as:
For these reasons I would like the version numbers to be set in the config.xml. Any ideas?
Thanks
Requirements and Support. Please note that the versions listed here are for Cordova's Android package, cordova-android, and not for the Cordova CLI. To determine what version of Cordova's Android package is installed in your Cordova project, run the command cordova platform ls in the directory that holds your project.
At last with Cordova 3.5.0-0.2.4
I added this attribute to the <widget>
node config.xml
android-versionCode="10"
and the AndroidManifest.xml
was properly updated to
android:versionCode="10"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With