We take the app version in major.minor.patch format from config.xml, and then 
turn it into a numeric (non-decimal) version code as required by Android.

Our process for doing so is roughly `(patch + minor*100 + major*10000)`, but 
that falls down a bit if any of those parts are more than 2 digits. The maximum 
value for the versionCode is 2100000000.

To further complicate things, if you're using plugins like Crosswalk that 
produce separate x86 and armv7 versions, the version code is multiplied by 10 
to use the lowest digit to differentiate architectures (e.g., `(patch + 
minor*100 + major*10000)*10 + 2` for armv7 and `(patch + minor*100 + 
major*10000)*10 + 4` for x86). This has caused issues for people migrating from 
Crosswalk to the system WebView because their versionCode decreases after 
uninstalling the plugin.

Any change we make here will probably end up breaking someone's app, as 
evidenced by the range of issues reported in the past:
* https://issues.apache.org/jira/browse/CB-8976
* https://issues.apache.org/jira/browse/CB-11833
* https://issues.apache.org/jira/browse/CB-9465

I believe you can manually override the version code in config.xml with a 
`android-versionCode` attribute, and that should be documented.

[ Full content available at: 
https://github.com/apache/cordova-android/issues/481 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to