Error when run Android studio IDE

50,236

Solution 1

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" />

Solution 2

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.

Solution 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.

Solution 4

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

Solution 5

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)

Share:
50,236
Farshid Shekari
Author by

Farshid Shekari

#Open_to_work Feel free to drop me a message on Linkedin.

Updated on July 11, 2020

Comments

  • Farshid Shekari
    Farshid Shekari almost 4 years

    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

    • M D
      M D over 9 years
      Execute your AndroidStudio.exe as Run as Admin
    • Farshid Shekari
      Farshid Shekari over 9 years
      Gives again same error
    • dragi
      dragi over 9 years
      Have you downloaded a full SDK?
    • Farshid Shekari
      Farshid Shekari over 9 years
      Yes, I had download android studio with SDK!
    • Farshid Shekari
      Farshid Shekari over 9 years
      I download full sdk pack from this site and again download android studio without sdk and when install this version of android studio I set sdk path it and run it but when run emulator is very slow and I can't install api24 when I want install it occur error! I download sdk package from goo.gl/HpHozj . You can view details in image in that page.
    • Ali Rasoulian
      Ali Rasoulian over 9 years
      Hi @Farshid, Did you find a solution for this problem finally?
    • Muhammad Babar
      Muhammad Babar about 9 years
      The team working on Android Studio are busy enjoying Free Snacks.
    • nagarajan
      nagarajan about 9 years
      Its worked for me as M D said, run as admin.
    • Dheeraj Vepakomma
      Dheeraj Vepakomma almost 9 years
  • Farshid Shekari
    Farshid Shekari over 9 years
    I can't understand your answer
  • M.K
    M.K over 9 years
    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.
  • Farshid Shekari
    Farshid Shekari over 9 years
    If you look at to comments under question, I tested this way before but not worked!
  • rsano
    rsano over 9 years
    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?
  • Farshid Shekari
    Farshid Shekari over 9 years
    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!
  • Charles Clayton
    Charles Clayton over 9 years
    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.
  • Charles Clayton
    Charles Clayton over 9 years
    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.
  • Charles Clayton
    Charles Clayton over 9 years
    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.
  • Triynko
    Triynko about 9 years
    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".
  • Abdul Rauf
    Abdul Rauf about 9 years
    it worked for me. Thanks :) I think android studio should ask for proxy settings at start if it is unable to connect to internet
  • lppier
    lppier about 9 years
    This worked for me. But then Google, shouldn't it just work? Even in offline mode...