bj4947
bj4947

Reputation: 910

cannot download Android build-tools on Jenkins

I am trying to update the android sdk using filter feature. So far, I am having difficult time to download/update the build-tools. I had already make the

buildToolsVersion "23.0.3"

in build.gradle file in the project. As the build-tools is not part of the file I downloaded, running android update sdk is the only option I have.

Here is the script,

wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
tar -xvf android-sdk_r24.4.1-linux.tgz

// using the following to check the available build-tools and I did saw 23.0.3

./android-sdk-linux/tools/android list sdk --all --extended


( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | ./android-sdk-linux/tools/android update sdk --no-ui --filter tool,platform-tool,build-tools-23.0.3,platform,extra
echo sdk.dir=android-sdk-linux > local.properties



./gradlew assemble
./gradlew test --continue

The command gives me an error of

Error: Ignoring unknown package filter 'build-tools-23.0.3'

also

15:14:02 + ./gradlew assemble
15:14:03 
15:14:03 FAILURE: Build failed with an exception.
15:14:03 
15:14:03 * What went wrong:
15:14:03 A problem occurred configuring project ':MYPROJECT'.
15:14:03 > failed to find Build Tools revision 23.0.3

When I change it to build-tools-24.0.0 and I was able to download the build tools however, this is not the right build tool I need (I think 24 is for preview only), I am looking for a stable version. Can anyone please tell me how to download either build-tools-23.0.1 or build-tools-23.0.3 using the command line?

Upvotes: 1

Views: 990

Answers (1)

Dr. Nitpick
Dr. Nitpick

Reputation: 1712

You will need to include --all in your update command. Otherwise the command ignores the older versions of the build tools. However you should run this separately from the other downloads so that you don't download all the platform-tools, all the platforms, all the tools, and all the extras. So you should call:

./android-sdk-linux/tools/android update sdk --no-ui --filter tool,platform-tool,platform,extra

and

./android-sdk-linux/tools/android update sdk --no-ui --all --filter build-tools-23.0.3

each with your other logic that inputs 'y' to accept the licenses.

Upvotes: 3

Related Questions