Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-14497

Can't start emulator with new Android SDK Tools rev. 20.0.1

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • None
    • Windows Server 2003 R2, Jenkins 1.460, Android Emulator Plugin 2.2

    Description

      After updating the Android SDK to rev. 20.0.1, the Android Emulator can't be started anymore due to the following error:

      FATAL: For input string: "20.0.1"
      java.lang.NumberFormatException: For input string: "20.0.1"
      at java.lang.NumberFormatException.forInputString(Unknown Source)
      at java.lang.Integer.parseInt(Unknown Source)
      at java.lang.Integer.parseInt(Unknown Source)
      at hudson.plugins.android_emulator.util.Utils$2.call(Utils.java:187)
      at hudson.plugins.android_emulator.util.Utils$2.call(Utils.java:156)
      at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
      at hudson.plugins.android_emulator.util.Utils.getAndroidSdk(Utils.java:197)
      at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:225)
      at hudson.model.Build$RunnerImpl.doRun(Build.java:133)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475)
      at hudson.model.Run.run(Run.java:1421)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:238)

      It seems that the new SDK version is the first one that uses a String as the revision "number" and the android emulator plugin can't cope with this.

      Attachments

        Activity

          kevinchow Kevin Chow added a comment -

          Thank you for the fix. Would you push it as Plugin 2.3? So we could upgrade the plugin on our side? Thanks!

          kevinchow Kevin Chow added a comment - Thank you for the fix. Would you push it as Plugin 2.3? So we could upgrade the plugin on our side? Thanks!
          tcollins Ted Collins added a comment -

          Many thanks for creating and maintaining this plugin. It's a huge help. Also blocked waiting for this as an update. I have searched around a bit, and have not seen this reported, but if I try to create an emulator at leave 16, the plugin seems to chop off the "6," look for sdk level 1 and then never launch. Might be my imagination, it happens.

          tcollins Ted Collins added a comment - Many thanks for creating and maintaining this plugin. It's a huge help. Also blocked waiting for this as an update. I have searched around a bit, and have not seen this reported, but if I try to create an emulator at leave 16, the plugin seems to chop off the "6," look for sdk level 1 and then never launch. Might be my imagination, it happens.
          12delta Simon Strauch added a comment -

          I tried applying the Integer.parseInt() and the fall-back with the RegEx to the String "16" of this change. It works, both return the number 16.

          java.util.regex.Pattern REVISION = java.util.regex.Pattern.compile("(\\d+)(?:\\.\\d+){0,2}");
          java.util.regex.Matcher m = REVISION.matcher("16");
          m.matches(); // return true
          String num = m.group(1); // num is "16"
          return Integer.parseInt(num); // returns 16
          
          12delta Simon Strauch added a comment - I tried applying the Integer.parseInt() and the fall-back with the RegEx to the String "16" of this change. It works, both return the number 16. java.util.regex.Pattern REVISION = java.util.regex.Pattern.compile( "(\\d+)(?:\\.\\d+){0,2}" ); java.util.regex.Matcher m = REVISION.matcher( "16" ); m.matches(); // return true String num = m.group(1); // num is "16" return Integer .parseInt(num); // returns 16

          Version 2.3 of the plugin has been released, which fixes this issue.

          orrc Christopher Orr added a comment - Version 2.3 of the plugin has been released, which fixes this issue.

          Hi guys, it still doesn't work with the Version 2.3 of the emulator plugin. I still get the same Error messages. Are you sure this was fixed???

          christos Christos Dovas added a comment - Hi guys, it still doesn't work with the Version 2.3 of the emulator plugin. I still get the same Error messages. Are you sure this was fixed???

          People

            orrc Christopher Orr
            miraculix_druids Miraculix Druids
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: