Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
5.3k views
in Technique[技术] by (71.8m points)

Android SDK installation failed (Jenkins' Android Emulator plugin) Caused by: java.io.IOException: Failed to donwload SDK archive

I've been trying to integrate Android Emulator in my Jenkins workflow on my Windows PC using this plugin. I've been facing this error.

Started by user admin
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building in workspace C:Usersuser.jenkinsworkspaceTesting if android emulator works
[android] Outdated SDK Tools found. Upgrading from '26.1.1' to 'build 6609375'
[android] Android SDK installation failed
[android] hudson.plugins.android_emulator.SdkInstallationException: Failed to download Android SDK
    at hudson.plugins.android_emulator.SdkInstaller.doInstall(SdkInstaller.java:91)
    at hudson.plugins.android_emulator.SdkInstaller.install(SdkInstaller.java:72)
    at hudson.plugins.android_emulator.AndroidEmulator.setUp(AndroidEmulator.java:278)
    at hudson.model.Build$BuildExecution.doRun(Build.java:157)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:514)
    at hudson.model.Run.execute(Run.java:1907)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.IOException: Failed to donwload SDK archive
    at hudson.plugins.android_emulator.SdkInstaller.installBasicSdk(SdkInstaller.java:189)
    at hudson.plugins.android_emulator.SdkInstaller.doInstall(SdkInstaller.java:89)
    ... 8 more

Finished: NOT_BUILT

I have taken the following steps after seeing people's discussions on SO and other websites (but haven't been able to resolve the issue):

  • Updated to latest android skd, and sdk command line tools. Also, updated possibly everything else that I could from Android Studio.
  • Added windows/system32 in path in env variables
  • Ran cmd as admin to run jenkins (realised later that it's a bad idea as scripts can do anything)
  • Went to http://localhost:8080/configure > set Android SDK root variable.
  • Went to http://localhost:8080/configure > tick Environment variables > set ANDROID_HOME & JAVA_HOME variables.
  • Went to http://localhost:8080/configureTools/ > set jdk installation.

Note: I've verified that all environment variables are correct.

Here's some of my thought process:

  • The error message says that it's trying to update tools from v 26.1.1 to a newer version. But I don't even have sdk tools of this version in my Android SDK!

  • This may hint to a dual installation of Android sdk but there only one. And after that, I don't know what's wrong...

I'm stuck on this for several days now & any help or suggestion will be greatly appreciated :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In the ENV, you specified paths to internal Android SDK tools? For example, you add to PATH /emulator and /platform-tools folders? This folders contains in the Android SDK root.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...