cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Clelland (JIRA)" <>
Subject [jira] [Commented] (CB-8976) platforms/android/build.gradle modifies android versionCode
Date Fri, 23 Oct 2015 15:04:27 GMT


Ian Clelland commented on CB-8976:

It was there as a poor-man's multiplication-by-ten.

When we were adding support for Crosswalk, and multiple engines in general, the issue came
up that you might want to ship crosswalk for some versions of android, and not for others
(say, for ICS to KitKat, but not for Lollipop and higher). Because of the way that the play
store works, though, you need to make sure that the APK you want sent to a device has a higher
version number than any other eligible APK. The solution was to shift the application version
over by 1 digit, and then use the LSD to specify things like architecture, webview engine,

So, for an app version of "1.2.3", the version code here would end up as "1230" (IIRC), and
we could do things like:
Base version (applies to all devices): 1230
ARM Xwalk version (minsdk = ICS): 1231
Intel Xwalk version (minsdk = ICS): 1232
Chromium webview version (minsdk = KK): 1233

And we could generate all of these version automatically, without making the developer change
the version string in the manifest for each build.

> platforms/android/build.gradle modifies android versionCode
> -----------------------------------------------------------
>                 Key: CB-8976
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI
>         Environment: Android
>            Reporter: zack dykes
> cordova 5.0.0
> platforms/android/build.gradle modifies android versionCode at ln 178
> as I understand it max size for versionCode is (2^31)-1 
> in my config.xml: 
> {code}
> android-versionCode="1385039613"
> {code}
> when I run {{cordova build android}}, I get:
> {code}
> FAILURE: Build failed with an exception.
> * Where:
> Build file '/Users/zackd/dev/code/cordova/cordova-ansr-fat-client/ondeviceresearch/platforms/android/build.gradle'
line: 178
> * What went wrong:
> A problem occurred evaluating root project 'android'.
> > For input string: "13850396130"
> {code}
> and build.gradle, ln 178
> {code}
> versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode")
+ "0")
> {code}
> looks like this is appending "0" to my versionCode, producing 13850396130 which is larger
than max size for android versionCode
> if I mod ln 178 as follows, build succeeds
> {code}
> versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode"))
> {code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message