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

Android SDK installation fails

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When installing and updating the Android SDK, the installation fails, because an obsolete flat (-o) is used. I think it should use --all.

      Here's a log:

      [android] Searching for Android projects...
      [android] Project file 'project.properties' requires platform 'android-15'
      [android] No Android SDK found; let's install it automatically...
      Downloading and installing Android SDK from http://dl.google.com/android/android-sdk_r21.0.1-macosx.zip
      [android] Base SDK installed successfully
      [android] Going to install required Android SDK components...
      [android] Installing the 'platform-tool,tool' SDK component(s)...
      $ /Users/hugo/Code/jenkins/slave/tools/android-sdk/tools/android update sdk -u -o -t platform-tool,tool
      Error: Flag '-o' is not valid for 'update sdk'.

      Usage:
      android [global options] update sdk [action options]
      Global options:
      -h --help : Help on a specific command.
      -v --verbose : Verbose mode, shows errors, warnings and all messages.
      --clear-cache: Clear the SDK Manager repository manifest cache.
      -s --silent : Silent mode, shows errors only.

      Action "update sdk":
      Updates the SDK by suggesting new platforms to install if available.
      Options:
      --proxy-port: HTTP/HTTPS proxy port (overrides settings if defined)
      --proxy-host: HTTP/HTTPS proxy host (overrides settings if defined)
      -s --no-https : Uses HTTP instead of HTTPS (the default) for downloads.
      -a --all : Includes all packages (such as obsolete and non-dependent
      ones.)
      -f --force : Forces replacement of a package or its parts, even if
      something has been modified.
      -u --no-ui : Updates from command-line (does not display the GUI)
      -p --obsolete : Deprecated. Please use --all instead.
      -t --filter : A filter that limits the update to the specified types of
      packages in the form of a comma-separated list of
      [platform, system-image, tool, platform-tool, doc, sample,
      source]. This also accepts the identifiers returned by
      'list sdk --extended'.
      -n --dry-mode : Simulates the update but does not download or install
      anything.
      [android] Android SDK installation failed
      Build step 'Install Android project prerequisites' marked build as failure
      Archiving artifacts
      Finished: FAILURE

        Attachments

          Activity

          Hide
          orrc Christopher Orr added a comment -

          Hmm. I fixed this about a year ago when SDK Tools r17 came out:
          https://github.com/jenkinsci/android-emulator-plugin/commit/4a1fee5

          I couldn't reproduce this just now with the plugin installing the SDK.
          I did once see a bug where `sdk.getSdkToolsVersion()` returned the wrong value, but I fixed that recently (I believe).
          And from your log it seems that the plugin is using the just-installed SDK as expected, so I'm not sure what's going wrong there..

          I guess you're using the latest plugin version (plus the Serializable fix), on OS X.
          Do you have another Android SDK configured in the global Jenkins properties, an Android SDK in your PATH, ANDROID_HOME etc.?

          Show
          orrc Christopher Orr added a comment - Hmm. I fixed this about a year ago when SDK Tools r17 came out: https://github.com/jenkinsci/android-emulator-plugin/commit/4a1fee5 I couldn't reproduce this just now with the plugin installing the SDK. I did once see a bug where `sdk.getSdkToolsVersion()` returned the wrong value, but I fixed that recently (I believe). And from your log it seems that the plugin is using the just-installed SDK as expected, so I'm not sure what's going wrong there.. I guess you're using the latest plugin version (plus the Serializable fix), on OS X. Do you have another Android SDK configured in the global Jenkins properties, an Android SDK in your PATH, ANDROID_HOME etc.?
          Hide
          botteaap Hugo Visser added a comment -

          Well, in the log my laptop is a slave for the Jenkins master that runs on Ubuntu, but I've seen the same error when provisioning a new EC2 instance, but I can check again to be sure.

          I checked the settings on the master and that doesn't have ANDROID_SDK_ROOT configured (it's empty). The master doesn't have an Android SDK installed, it's too weak to build anything

          Maybe this is related to running as a slave, e.g. version check is on the master, not the slave?

          Show
          botteaap Hugo Visser added a comment - Well, in the log my laptop is a slave for the Jenkins master that runs on Ubuntu, but I've seen the same error when provisioning a new EC2 instance, but I can check again to be sure. I checked the settings on the master and that doesn't have ANDROID_SDK_ROOT configured (it's empty). The master doesn't have an Android SDK installed, it's too weak to build anything Maybe this is related to running as a slave, e.g. version check is on the master, not the slave?
          Hide
          orrc Christopher Orr added a comment -

          I was testing this yesterday with a slave, but yeah I'll also try again with a completely different machine, e.g. starting on a new EC2 instance.

          I believe all the SdkInstaller code runs together on the slave, but I'll double-check.

          Show
          orrc Christopher Orr added a comment - I was testing this yesterday with a slave, but yeah I'll also try again with a completely different machine, e.g. starting on a new EC2 instance. I believe all the SdkInstaller code runs together on the slave, but I'll double-check.
          Hide
          brianjriddle brianjriddle added a comment -

          I can verify that it looks like the check SdkInstaller.java String all = sdk.getSdkToolsVersion() looks like it runs only on the master and not on the slave where the tools are installed. Tried to build on both a macosx slave and an linux slave with no success getting the sdk to install.

          Switched over to running this on master and it works. I have seen some mention of running commands like this on the slave via an jenkins api call.

          Show
          brianjriddle brianjriddle added a comment - I can verify that it looks like the check SdkInstaller.java String all = sdk.getSdkToolsVersion() looks like it runs only on the master and not on the slave where the tools are installed. Tried to build on both a macosx slave and an linux slave with no success getting the sdk to install. Switched over to running this on master and it works. I have seen some mention of running commands like this on the slave via an jenkins api call.
          Hide
          sluplow Steven Luplow added a comment - - edited

          I was trying to update to the latest tools version so I could then run API 17 on Jekins. I experienced the same issue. Our set up is - jenkins runs on top of a OpenIndiana host, over SSH it connects to a Linux slave. The Linux slave is where the SDK and all the installed tools live..

          Here is our log message:

          [android] No Android SDK found; let's install it automatically...
          Downloading and installing Android SDK from http://dl.google.com/android/android-sdk_r21.0.1-linux.tgz
          [android] Base SDK installed successfully
          [android] Going to install required Android SDK components...
          [android] Installing the 'platform-tool,tool' SDK component(s)...
          $ /home/jenkins/tools/android-sdk/tools/android update sdk -u -o -t platform-tool,tool
          Error: Flag '-o' is not valid for 'update sdk'.

          Usage:
          android [global options] update sdk [action options]
          Global options:
          -h --help : Help on a specific command.
          -v --verbose : Verbose mode, shows errors, warnings and all messages.
          --clear-cache: Clear the SDK Manager repository manifest cache.
          -s --silent : Silent mode, shows errors only.

          Action "update sdk":
          Updates the SDK by suggesting new platforms to install if available.
          Options:
          --proxy-port: HTTP/HTTPS proxy port (overrides settings if defined)
          --proxy-host: HTTP/HTTPS proxy host (overrides settings if defined)
          -s --no-https : Uses HTTP instead of HTTPS (the default) for downloads.
          -a --all : Includes all packages (such as obsolete and non-dependent
          ones.)
          -f --force : Forces replacement of a package or its parts, even if
          something has been modified.
          -u --no-ui : Updates from command-line (does not display the GUI)
          -p --obsolete : Deprecated. Please use --all instead.
          -t --filter : A filter that limits the update to the specified types of
          packages in the form of a comma-separated list of
          [platform, system-image, tool, platform-tool, doc, sample,
          source]. This also accepts the identifiers returned by
          'list sdk --extended'.
          -n --dry-mode : Simulates the update but does not download or install
          anything.
          ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
          java.lang.NullPointerException
          at hudson.plugins.android_emulator.util.Utils.getToolCommand(Utils.java:369)
          at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:413)
          at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:406)
          at hudson.plugins.android_emulator.SdkInstaller.isPlatformInstalled(SdkInstaller.java:258)
          at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:205)
          at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:190)
          at hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:177)
          at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:250)
          at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:600)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580)
          at hudson.model.Run.execute(Run.java:1575)
          at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:237)
          project=hudson.maven.MavenModuleSet@1a42f7f[absio-android-IT-4.2]
          project.getModules()=[]
          project.getRootModule()=null
          FATAL: null
          java.lang.NullPointerException
          at hudson.plugins.android_emulator.util.Utils.getToolCommand(Utils.java:369)
          at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:413)
          at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:406)
          at hudson.plugins.android_emulator.SdkInstaller.isPlatformInstalled(SdkInstaller.java:258)
          at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:205)
          at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:190)
          at hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:177)
          at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:250)
          at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:600)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580)
          at hudson.model.Run.execute(Run.java:1575)
          at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:237)

          Show
          sluplow Steven Luplow added a comment - - edited I was trying to update to the latest tools version so I could then run API 17 on Jekins. I experienced the same issue. Our set up is - jenkins runs on top of a OpenIndiana host, over SSH it connects to a Linux slave. The Linux slave is where the SDK and all the installed tools live.. Here is our log message: [android] No Android SDK found; let's install it automatically... Downloading and installing Android SDK from http://dl.google.com/android/android-sdk_r21.0.1-linux.tgz [android] Base SDK installed successfully [android] Going to install required Android SDK components... [android] Installing the 'platform-tool,tool' SDK component(s)... $ /home/jenkins/tools/android-sdk/tools/android update sdk -u -o -t platform-tool,tool Error: Flag '-o' is not valid for 'update sdk'. Usage: android [global options] update sdk [action options] Global options: -h --help : Help on a specific command. -v --verbose : Verbose mode, shows errors, warnings and all messages. --clear-cache: Clear the SDK Manager repository manifest cache. -s --silent : Silent mode, shows errors only. Action "update sdk": Updates the SDK by suggesting new platforms to install if available. Options: --proxy-port: HTTP/HTTPS proxy port (overrides settings if defined) --proxy-host: HTTP/HTTPS proxy host (overrides settings if defined) -s --no-https : Uses HTTP instead of HTTPS (the default) for downloads. -a --all : Includes all packages (such as obsolete and non-dependent ones.) -f --force : Forces replacement of a package or its parts, even if something has been modified. -u --no-ui : Updates from command-line (does not display the GUI) -p --obsolete : Deprecated. Please use --all instead. -t --filter : A filter that limits the update to the specified types of packages in the form of a comma-separated list of [platform, system-image, tool, platform-tool, doc, sample, source]. This also accepts the identifiers returned by 'list sdk --extended'. -n --dry-mode : Simulates the update but does not download or install anything. ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com java.lang.NullPointerException at hudson.plugins.android_emulator.util.Utils.getToolCommand(Utils.java:369) at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:413) at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:406) at hudson.plugins.android_emulator.SdkInstaller.isPlatformInstalled(SdkInstaller.java:258) at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:205) at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:190) at hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:177) at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:250) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:600) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580) at hudson.model.Run.execute(Run.java:1575) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) project=hudson.maven.MavenModuleSet@1a42f7f [absio-android-IT-4.2] project.getModules()=[] project.getRootModule()=null FATAL: null java.lang.NullPointerException at hudson.plugins.android_emulator.util.Utils.getToolCommand(Utils.java:369) at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:413) at hudson.plugins.android_emulator.util.Utils.runAndroidTool(Utils.java:406) at hudson.plugins.android_emulator.SdkInstaller.isPlatformInstalled(SdkInstaller.java:258) at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:205) at hudson.plugins.android_emulator.SdkInstaller.installPlatform(SdkInstaller.java:190) at hudson.plugins.android_emulator.SdkInstaller.installDependencies(SdkInstaller.java:177) at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:250) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:600) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580) at hudson.model.Run.execute(Run.java:1575) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christopher Orr
          Path:
          src/main/java/hudson/plugins/android_emulator/SdkInstaller.java
          src/main/java/hudson/plugins/android_emulator/sdk/AndroidSdk.java
          http://jenkins-ci.org/commit/android-emulator-plugin/0bee4d3602a7d46a898f8c30cfb4b6572e814c30
          Log:
          [FIXED JENKINS-16720] Ensure SDK version check is done on the right node.

          Previously, when automatically installing the SDK, we were instantiating
          an SDK object on the master, meaning that we were inspecting the tools
          version file on the master, rather than on the node in question.

          Also removed the empty catch block which was masking this problem.

          Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/2035f3c789b7...0bee4d3602a7

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/SdkInstaller.java src/main/java/hudson/plugins/android_emulator/sdk/AndroidSdk.java http://jenkins-ci.org/commit/android-emulator-plugin/0bee4d3602a7d46a898f8c30cfb4b6572e814c30 Log: [FIXED JENKINS-16720] Ensure SDK version check is done on the right node. Previously, when automatically installing the SDK, we were instantiating an SDK object on the master, meaning that we were inspecting the tools version file on the master, rather than on the node in question. Also removed the empty catch block which was masking this problem. Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/2035f3c789b7...0bee4d3602a7
          Hide
          orrc Christopher Orr added a comment -

          Version 2.9 has been released, which includes this fix.

          Show
          orrc Christopher Orr added a comment - Version 2.9 has been released, which includes this fix.

            People

            • Assignee:
              orrc Christopher Orr
              Reporter:
              botteaap Hugo Visser
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: