You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/08/22 16:44:08 UTC
[GitHub] dpogue commented on issue #481: Version code formula generates a
lower number for a later version.
dpogue commented on issue #481: Version code formula generates a lower number for a later version.
URL: https://github.com/apache/cordova-android/issues/481#issuecomment-415099046
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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org