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

Plugin does not work with Android build tools 26.0.2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Mac Sierra 10.12.4
      Android Studio 2.3.1
      Jenkins 2.19.4
      android-emulator-plugin 2.15
      Android build tools 26.0.2
    • Similar Issues:

      Description

      After upgrading to android build tools 26.0.2, the plugin no longer works. Here are the logs we see

      [android] Starting Android emulator
      <PATH_TO_ANDROID_HOME>android/tools/emulator -engine classic -ports 5784,5785 -report-console tcp:5853,max=60 -avd ci-22 -no-snapshot-load -no-snapshot-save -no-audio -no-window
      PANIC: Missing emulator engine program for 'x86' CPU.
      [android] Emulator did not appear to start; giving up
      [android] Stopping Android emulator
      

      After digging into things, we found that Android have moved things around with the recent build tools and now the emulator tools are found at "android/emulator/" instead of "android/tools/emulator"

      So we changed the plugin code, in particular the AndroidEmulator class, to look for the emulator at the new path. Things started to improve a little, however now we get this....

      emulator: ERROR: could not connect to server on TCP:5868: Operation timed out
      

      The "-report-console" argument seems to be the problem. If this argument is left out the emulator starts ok, however the plugin can't interact with it and times out.

      [android] Emulator did not appear to start; giving up
      [android] Stopping Android emulator
      

      Any ideas?

      Regards,
      Dom

        Attachments

          Activity

          Hide
          redeamer Michael Musenbrock added a comment -

          Call for comment and review: I addressed this issue with PR #71 further info can be found there.

          Show
          redeamer Michael Musenbrock added a comment - Call for comment and review: I addressed this issue with PR #71  further info can be found there.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Michael Musenbrock
          Path:
          src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java
          src/main/java/hudson/plugins/android_emulator/Constants.java
          src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java
          src/main/java/hudson/plugins/android_emulator/SdkInstaller.java
          src/main/java/hudson/plugins/android_emulator/sdk/AndroidSdk.java
          src/main/java/hudson/plugins/android_emulator/sdk/EmulatorToolLocator.java
          src/main/java/hudson/plugins/android_emulator/sdk/Tool.java
          src/main/java/hudson/plugins/android_emulator/util/Utils.java
          src/main/resources/hudson/plugins/android_emulator/AndroidEmulator/config.jelly
          src/main/resources/hudson/plugins/android_emulator/Messages.properties
          src/main/webapp/help-deviceDefinition.html
          src/test/java/hudson/plugins/android_emulator/AndroidPlatformTest.java
          src/test/java/hudson/plugins/android_emulator/EmulatorConfigTest.java
          src/test/java/hudson/plugins/android_emulator/sdk/AndroidSdkTest.java
          src/test/java/hudson/plugins/android_emulator/util/UtilsTest.java
          http://jenkins-ci.org/commit/android-emulator-plugin/3b9e5b948f4c542301aa048f4147189f7e7856d7
          Log:
          [FIXED JENKINS-40178][FIXED JENKINS-43215][FIXED JENKINS-44490] Add support for Android Emulator 2.0

          Added support for the 'new' Android Emulator 2.0, which got support in SDK Tools v25 but
          was lacking some functionality the plugin relies on. Since SDK Tools v26 the new emulator
          engine supports all needed flags and parameters.

          The plugin creates AVDs and starts the emulator in legacy format or in the new format,
          dependent of which SDK Tools version is installed (<= 25 legacy, >= 26 new format).

          A new configuration option was added ('Device definition') which is needed (to avoid
          user input) on AVD creation. It is used to define a specific device ('avdmanager list device'),
          but it is only respected if SDK Tools >= 26 are used.

          Added a helper class AndroidPlatformVersions which holds the current data of platforms,
          which was moved from AndroidPlatform. Additional AndroidPlatform got refactored to
          handle and retrieve more information needed for the emulator (package path) and
          for more convenient access to vendor and api information of the used platform.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Musenbrock Path: src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java src/main/java/hudson/plugins/android_emulator/Constants.java src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java src/main/java/hudson/plugins/android_emulator/SdkInstaller.java src/main/java/hudson/plugins/android_emulator/sdk/AndroidSdk.java src/main/java/hudson/plugins/android_emulator/sdk/EmulatorToolLocator.java src/main/java/hudson/plugins/android_emulator/sdk/Tool.java src/main/java/hudson/plugins/android_emulator/util/Utils.java src/main/resources/hudson/plugins/android_emulator/AndroidEmulator/config.jelly src/main/resources/hudson/plugins/android_emulator/Messages.properties src/main/webapp/help-deviceDefinition.html src/test/java/hudson/plugins/android_emulator/AndroidPlatformTest.java src/test/java/hudson/plugins/android_emulator/EmulatorConfigTest.java src/test/java/hudson/plugins/android_emulator/sdk/AndroidSdkTest.java src/test/java/hudson/plugins/android_emulator/util/UtilsTest.java http://jenkins-ci.org/commit/android-emulator-plugin/3b9e5b948f4c542301aa048f4147189f7e7856d7 Log: [FIXED JENKINS-40178] [FIXED JENKINS-43215] [FIXED JENKINS-44490] Add support for Android Emulator 2.0 Added support for the 'new' Android Emulator 2.0, which got support in SDK Tools v25 but was lacking some functionality the plugin relies on. Since SDK Tools v26 the new emulator engine supports all needed flags and parameters. The plugin creates AVDs and starts the emulator in legacy format or in the new format, dependent of which SDK Tools version is installed (<= 25 legacy, >= 26 new format). A new configuration option was added ('Device definition') which is needed (to avoid user input) on AVD creation. It is used to define a specific device ('avdmanager list device'), but it is only respected if SDK Tools >= 26 are used. Added a helper class AndroidPlatformVersions which holds the current data of platforms, which was moved from AndroidPlatform. Additional AndroidPlatform got refactored to handle and retrieve more information needed for the emulator (package path) and for more convenient access to vendor and api information of the used platform.
          Hide
          orrc Christopher Orr added a comment -

          Version 3.0 of the plugin has been release, which solves this issue.

          Show
          orrc Christopher Orr added a comment - Version 3.0 of the plugin has been release, which solves this issue.

            People

            • Assignee:
              orrc Christopher Orr
              Reporter:
              dominicmarmion Dominic Marmion
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: