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

platforms/android/build.gradle modifies android versionCode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • cordova-android
    • None
    • 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

              bowserj Joey Robert Bowser
              zackd zack dykes
              Votes:
              15 Vote for this issue
              Watchers:
              27 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: