29

When I launch Android studio I encounter this Error:

enter image description here

 The following SDK components were not installed: build-tools-21.1.1, source-21, sys-img-x86-addon-google_apis-google-21, extra-android-m2repository, android-21, extra-google-m2repository, addon-google_apis-google-21, tools, platform-tools 

And when I click retry, it gives me the same error:

enter image description here

9
  • 2
    Execute your AndroidStudio.exe as Run as Admin Commented Dec 22, 2014 at 11:59
  • Gives again same error Commented Dec 22, 2014 at 12:06
  • Have you downloaded a full SDK? Commented Dec 22, 2014 at 12:12
  • 1
    Yes, I had download android studio with SDK! Commented Dec 22, 2014 at 12:14
  • 2
    The team working on Android Studio are busy enjoying Free Snacks. Commented Feb 3, 2015 at 13:13

12 Answers 12

18

Configure a proxy for Android studio by modifying other.xml file at:

C:\Users\"Your account"\.AndroidStudio\config\options\other.xml

Then change the proxy configurations as follows:

<option name="USE_HTTP_PROXY" value="true" /> <option name="USE_PROXY_PAC" value="false" /> <option name="PROXY_HOST" value="your_proxy_server" /> <option name="PROXY_PORT" value="your_proxy_port" /> 
Sign up to request clarification or add additional context in comments.

2 Comments

This solved the first part of my problem which was that it couldn't install tools and extra-android m2repository, then after that I had the same error but for build-tools-21.1.1 which I solved using Alexander Prokofyev's solution.
it worked for me. Thanks :) I think android studio should ask for proxy settings at start if it is unable to connect to internet
12

code.google.com/p/android/issues/detail?id=82789

  1. download build-tools21.1.1 google link or dehkadeco.ir link

  2. sdk will be located under C:\Users\<>\AppData\Local\Android\sdk.

  3. You may find that 21.1.2 is already in place C:\Users\<>\AppData\Local\Android\sdk\build-tools Create a folder with name "21.1.1" under this.

  4. Copy all the files from the downloaded build-tools:21.1.1 under android-5.0 to C:\Users\<>\AppData\Local\Android\sdk\build-tools\21.1.1

  5. Start the Android studio now.

2 Comments

I had this problem too and solved it this way, but I had to use Erfan Jazeb Nikoo's method first for the first set of problems. Then I got different errors and solved it this way.
This worked for me. But then Google, shouldn't it just work? Even in offline mode...
3

Try to rename folder 21.1.2 inside Android SDK build-tools folder (in my case it was c:\Users\prokofyev\AppData\Local\Android\sdk\build-tools\21.1.2) to android-5.0 (in my case it became c:\Users\prokofyev\AppData\Local\Android\sdk\build-tools\android-5.0). This way I fixed similar error on new Android Studio installation.

2 Comments

First I had to do what Erfan Jazeb Nikboo suggested, then I think I had the same problem as you. In the application I was told that it couldn't download build-tools 21.1.1, but inside build-tools I had folder 21.1.2. I downloaded 21.1.1 from here: downloads.puresoftware.org/files/android/build-tools and put it in build-tools with and named the folder 21.1.1 and that solved my problems.
To clarify, when you download the build-tools-21.1.1.zip file, it actually contains a folder named "android-5.0", rather than "21.1.1" as you might expect. I downloaded that, extracted it to the build-tools directory (so now I had both a "21.1.2" and a "android-5.0" directory, I hit "retry" on the error message and it succeeded. Although it finished with a new error "Unable to create a virtual device: Unable to create Android virtual device".
2

Android Studio was not able to connect to internet in my work PC due to Intranet Proxy/Firewall settings, changing the proxy settings didnt help me either.

Android studio was failing to run as it requires to install the above mentioned packages. As a work around I installed the packages from Android SDK Manager and it solved it.

You can find the SDK Manager under C:\Users\< UserName> \AppData\Local\Android\sdk\SDK Manager.exe In the GUI choose the following options whichever is relavant.

  • Tools->All Android SDK Build-tools and SDK Platform-tools under version 21.*
  • Everything under Android 5.0.1(API 21)
  • Everything under Extras

After installation is complete try launching the Android Studio

Comments

1

Adding to answer by @Erfan , If you are using automatic configuration script instead of a proxy server , Change the settings as below :

C:\Users\"Your account".AndroidStudio\config\options\other.xml

Then change the line about proxy configurations like this:

<component name="HttpConfigurable"> <option name="PROXY_TYPE_IS_SOCKS" value="false" /> <option name="USE_HTTP_PROXY" value="false" /> <option name="USE_PROXY_PAC" value="true" /> <option name="PROXY_HOST" value="" /> <option name="PROXY_PORT" value="80" /> <option name="PROXY_AUTHENTICATION" value="true" /> <option name="PROXY_LOGIN" value=" your User Name" /> <option name="PROXY_PASSWORD_CRYPT" value=" Your Domain Password " /> <option name="KEEP_PROXY_PASSWORD" value="false" /> <option name="myGenericPasswords"> <map /> </option> <option name="myGenericCancelled"> <set /> </option> <option name="PROXY_EXCEPTIONS" value="" /> <option name="USE_PAC_URL" value="true" /> <option name="PAC_URL" value=" Put Pac Url Here mentioned in Auto Config Script " /> </component> 

Comments

1

I had the same problem, But when I opened the studio "as administrator" error has gone!!! And my problem solved!!!! In my case I have installed the sdk in different location since I don't want install anything on my user folder.

enter image description here

There is one more thing I have done that is I made the folder as writable from read access. (But I don't think this step is necessary)

Comments

1

This usually happens when you can not download sdk from google, try to download it manually.

You can get the build you mentioned at google or bellow link:

this link

Unzip it in \sdk\build-tools

Comments

1

Some tools are missing.

Download build-tools_r21.1.1-windows.zip and unzip it. Run Android Studio again.

If you get similar error again Check this for missing android tools.

Enjoy coding..:)

Comments

0

For Ubuntu users, check that the folder where the SDK will be installed has permissions.

Comments

0

I also had the same problem. See the picture below:

enter image description here

Solution: Run it as an administrator.

enter image description here

3 Comments

If you look at to comments under question, I tested this way before but not worked!
Oh, I'm sorry if I didn't read it. It might help those who are having the same error though. Anyway, it's been two weeks and you haven't solved it yet? Have you tried a clean installation?
I download sdk package from this site(ehsanavr.com) and I download a android studio without sdk and then I installed and now that's work but that's speed is slow!
0

If you are getting UnknownHostException the the problem lies in the proxy - click the close icon (the X in the upper right corner) and agree to start setup next time again. Then in the Studio itself go to Configure -> Settings -> search for proxy and set up your proxy (auto-detect or manual).

Running as administrator might help as well

Comments

0

download build-tools:21.1.1 from build-tools_r21.1.1-windows.zip

and unzip, it will extract the entire folder to copy or move your sdk /build-tools folder. name folder must be build-tools_21.1.1

2 Comments

I can't understand your answer
The following SDK components were not installed: build-tools-21.1.1.this error means you don't download sdk commponents. So at the first you must download build-tools:21.1.1 package from dl-ssl.google.com/android/repository/…. and goto sdk path and goto build-tools folder and unzip your package into build-tools-21.1.1 folder.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.