Android-Jenkins: failed to find Build Tools revision 17.0.0 On Jenkins Build Server

霸气de小男生 提交于 2019-12-06 03:56:17

问题


I'm trying to use the Android Emulator on Jenkins to build and test my project. But I'm getting an the following error when running my gradle tasks;

failed to find Build Tools revision 17.0.0

the gradle task I'm running is;

./gradlew clean connectedCheck

in my gradle build file I has the following configuration

android {
  compileSdkVersion 17
  buildToolsVersion "17.0.0"

  defaultConfig {
    minSdkVersion 7
    targetSdkVersion 17
  }
}

The build server is a headless Ubuntu instance (12 something). My first thought was that I didn't have the correct build tools installed so I had a look in my android-sdk/build-tools director. All I could see was a directory called 18.1.1. So I thought if I updated my android sdk it would download version 17.0.0. So I ran the following command:

android update sdk --no-ui

and it seems to download various many things but looking in the build tools directory again I still only see version 18.1.1.

So questions are:

1) Am I right in assuming the build is failing because I don't have the correct build tools revision in my android sdk directory? (/android-sdk/build-tools)

2) How do I update the build-tools on a headless server so that I have version 17.0.0?

If you need me to provide more information, please let me know.

Thanks in advance for you help.


回答1:


By default, android update sdk (or android list sdk --extended) only lists the packages which aren't considered deprecated.

As Build Tools 17.0.0 is a comparatively old version, it won't be shown by default.

Running with the -a (--all) flag will get you the older versions, e.g.:
android update sdk -u -a -t build-tools-17.0.0


At some point in the future the Jenkins plugin should automatically install the correct build tools for you, based on your build.gradle file.


Edit (Nov 2015): This functionality probably will not be added to the Android Emulator plugin.

Nowadays I would recommend using the android-sdk-manager Gradle plugin, which automates the installation of all prerequisites for a Jenkins build, including Android SDK, tools, build-tools, platforms, support libraries etc.

This can be very easily integrated into your project, and removes the need to keep the Android SDK installation on your Jenkins build machines up-to-date.




回答2:


Other way to do it, is manually update for the missing version using Android SDK Manager attached to Jenkins (Look for Configuration: ANDROID_SDK, then under it access "tools/android.sh")



来源:https://stackoverflow.com/questions/19426477/android-jenkins-failed-to-find-build-tools-revision-17-0-0-on-jenkins-build-ser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!