59

I´m running a linux android sdk installation and my new project needs Build tools 21.1.1

Somehow, this build tools do not exist, eventhough my sdk is up to date, but in the build-tools folder there is now android-4.4W folder

android update sdk --no-ui

enter image description here

My sdk/build-tools folder

enter image description here

I´ve moved the content testwise to a 21.1.1 folder, but this isn´t recognized either.

Is this a bug?How to I get the right build tools?

Marian Klühspies
  • 15,824
  • 16
  • 93
  • 136

5 Answers5

126

What worked for me was:

android list sdk -a

Which showed me the following list:

1- Android SDK Tools, revision 24.0.2
2- Android SDK Platform-tools, revision 21
3- Android SDK Build-tools, revision 21.1.2
4- Android SDK Build-tools, revision 21.1.1
5- Android SDK Build-tools, revision 21.1
6- Android SDK Build-tools, revision 21.0.2
7- Android SDK Build-tools, revision 21.0.1
... and a great many more

Followed by the command:

android update sdk -a -u -t 3

The "3" in the command refers the the index listed in the output of the first command.

jzheaux
  • 7,042
  • 3
  • 22
  • 36
  • 1
    Bingo! I forgot I hid obsolete packages (that version is now), but all sample apps from sdk were referring to such. I was feeling lazy to adjust every sample I wanted to try:-) – mlt Nov 21 '15 at 00:38
  • 7
    Worked for me using react native complaining about `23.0.1` – Harry Moreno Dec 02 '15 at 20:46
  • I get a `Warning: The package filter removed all packages. There is nothing to install. Please consider trying to update again without a package filter.` – IgorGanapolsky Apr 22 '16 at 14:34
31

Solved it by using

android update sdk -u -a

where the a parameter installs all packages. Not the best solution to install everything, but it has at least installed the required build tools version

Marian Klühspies
  • 15,824
  • 16
  • 93
  • 136
30

I was getting this error on my Jenkins too:

failed to find Build Tools revision 21.1.2

Instead of getting all Android SDK updates, I just needed to:

Get Build Tools revision 21.1.2

sudo android update sdk --no-ui --all --filter build-tools-21.1.2

Other commands I've used:

Help:

sudo android update sdk --help

Get list of available Android SDK updates:

sudo android list sdk --extended --all
ViliusK
  • 11,345
  • 4
  • 67
  • 71
4

I had the same issue, and i could fix it by launching Android SDK Manager in Android Studio and install the Build Tools by checking the option.

naresh goty
  • 145
  • 7
-1

In the error window where it displayes message as failed to find build tools versions, it also gives the link to install the tools version. You can update using that.

If the above option is not available then another way is: Open the sdk tools tab from sdk manager in android studio. Click on 'Launch StandAlone SDK Manager'. In the new widnow, you will be able to see all the revisions of build tools, api levels, system images. From there you can can select the tools revision which are missing and install.

Ankita
  • 313
  • 1
  • 8
  • this question is just about installing it from console. In Android-Studio, everything is okay. You can easily install the latest packages only from the SDK Manager, so thats not the point – Marian Klühspies Nov 17 '15 at 17:47