Incorrect Cordova Android versioncode - by bodinaren

Status : 

 


1
0
Sign in
to vote
ID 1748409 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 9/3/2015 9:23:19 AM
Access Restriction Public

Description

I got a Cordova project and I've set an appropriate "android-versionCode" in the config.xml. However, when I upload the build to Google Play the version code has had a "8" added to it, e.g. 34 became 348, 349 became 3498. At first I thought it was a typo from me, but since it happened twice in a row now it has to be something Visual Studio does when compiling the APK.
Sign in to post a comment.
Posted by Microsoft on 9/8/2015 at 3:28 PM
Another option, if you don't like this behavior at all, is to create a "gradle.properties" file under res\native\android, and add the line "cdvVersionCode=[versionCode]", where [versionCode] is whatever you want it to be. This will bypass the augmenting behavior, and provide you with full control over the resulting code.
Posted by Microsoft on 9/8/2015 at 1:58 PM
Hi,

This is intentional behavior in Cordova, whether used through Visual Studio or via the command line. As long as you are always using Cordova to build your app, this extra digit should not be an issue, since the "augmented" number isn't written back into config.xml. If 34 is one version of your app, then you can specify the next as 35, and things will work as expected. The first built apk will be 348, and the next will be 358; the larger number indicates a later release, and upgrading will occur.

Hope that helps.
Posted by Microsoft on 9/3/2015 at 10:06 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If you require immediate assistance with this issue, please contact product support at http://support.microsoft.com/oas/default.aspx?prid=15825.