由于过时的SDK,Jenkins Android模拟器正在运行我如何在詹金斯上更新它

问题描述

我在本地系统上使用jenkins,并添加一个android模拟器插件,但这为过时的SDK报错。

 > C:\Program Files\Git\bin\git.exe rev-list --no-walk f04a1c2fe717dc9b6a3a329636f418e3dc853585 # timeout=10
[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:504)
    at hudson.model.Run.execute(Run.java:1894)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:428)
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

解决方法

我现在正在ubuntu服务器上处理完全相同的问题。 我所做的-手动下载sdk工具并将其安装在我的/ usr / lib / android-sdk文件夹中

  • wget -O sdk-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip
  • sudo apt install unzip
  • unzip sdk-tools.zip

这个问题现在在詹金斯身上消失了。