Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8976

platforms/android/build.gradle modifies android versionCode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-android
    • Labels:
      None
    • Environment:

      Android

      Description

      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
      http://stackoverflow.com/a/24246191/126600

      in my config.xml:

      android-versionCode="1385039613"
      

      when I run cordova build android, I get:

      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"
      

      and build.gradle, ln 178

      versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode") + "0")
      

      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

      versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode"))
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bowserj Joe Bowser
                Reporter:
                zackd zack dykes
              • Votes:
                15 Vote for this issue
                Watchers:
                29 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: