Updating Android SDK from command line

I was getting this error message trying to compile an Android application using the gradle :

* What went wrong:
Execution failed for task ':app:preBuild'.
> failed to find Build Tools revision 21.1.2

This error means there is not android 21.1.2 support on my SDK.

I can list all available versions and install it this way:

$ android list sdk -a

Packages available for installation or update: 156
   1- Android SDK Tools, revision 24.4
   2- Android SDK Platform-tools, revision 23.0.1
   3- Android SDK Platform-tools, revision 23.1 rc1
   4- Android SDK Build-tools, revision 23.0.1
   5- Android SDK Build-tools, revision 23 (Obsolete)
   6- Android SDK Build-tools, revision 22.0.1
   7- Android SDK Build-tools, revision 22 (Obsolete)
   8- Android SDK Build-tools, revision 21.1.2
   9- Android SDK Build-tools, revision 21.1.1 (Obsolete)
  10- Android SDK Build-tools, revision 21.1 (Obsolete)


$ android update sdk -a -u -t 8
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s