247

Not sure what I'm doing wrong here. I installed the Android SDK Manager, and am now trying to install a platform like the Android Dev website suggests. Once I clicked install I got an error stating that the Manager could not create a temp folder within the Android directory. So I created it. Now I'm getting this error:

Downloading SDK Platform Android 2.3, API 9, revision 1 File not found: C:\Program Files (x86)\Android\android-sdk-windows\temp\android-2.3_r01-linux.zip (Access is denied)

There is also a little message under the progress bar that says "Done. Nothing was installed."

I'm running Windows 7 Ultimate, in case that's of any use.

Will Tate
  • 32,629
  • 9
  • 75
  • 71
vince88
  • 3,219
  • 5
  • 22
  • 26
  • 28
    Run SDK Manager as Administrator. Don't open Android Studio or Eclipse. – Maheshkumar Aug 04 '14 at 08:33
  • @maheshrpm That worked for me, but what can I do in order to open SDK Manager as an administrator through Android Studio? I have already checked the option Run as Administrator in the file properties. – Clawdidr Aug 19 '14 at 00:25
  • 2
    @Clawdidr open Android Studio as Administrator! So SDK Manager also opens in Administrator privilege when you open from Android Studio. – Maheshkumar Sep 16 '14 at 02:53
  • I have changed the permission for the mentioned folder initially. C:\Program Files (x86)\Android\android-studio. Then started the 64 bit Android Studio as Run As Administrator. This worked perfectly for me.. – Ajay Kumar Meher Mar 15 '15 at 18:49
  • Running Android SDK Manager as Admin worked for me. Thanks – Bryan Labuschagne Sep 11 '17 at 09:20

17 Answers17

527

Try running Android Studio as an administrator, by right-clicking on the .exe and selecting "Run As Administrator".

Also, some anti-virus programs have been known to interfere with SDK Manager.

Dara
  • 21
  • 1
  • 3
Will Tate
  • 32,629
  • 9
  • 75
  • 71
  • 2
    It does not work for me, I cant install the android-sdk\tools even though I run as Administrator – Vass May 06 '12 at 10:42
  • 1
    @Vass where exactly is yours failing? – Will Tate May 06 '12 at 15:50
  • @willtate, I asked the question at http://stackoverflow.com/q/10470593/410975 and it worked in the end but through a weird route of changing the name of the folder it could not access then back again.. it works but through a mystery of actions. – Vass May 06 '12 at 17:49
  • 1
    @Vass Ok, I have seen that issue before as well. I answered a question on it here: http://stackoverflow.com/questions/8839255/failed-to-rename-directory-tools-to-temp-toolpackage-old01-in-c-android-sdk-win/ – Will Tate May 07 '12 at 14:13
  • Disabling the firewall worked for me. I also had antivirus disabled and ran SDK Manager as administrator. See http://stackoverflow.com/questions/3808167/android-sdk-manager-gives-failed-to-fetch-url-https-dl-ssl-google-com-android – chrysanhy Jun 13 '12 at 18:13
  • This worked for me as well. In my case, this was my first time attempting to run Android Studio after a fresh install; so, I had to start the Android Studio application while selecting "Run As Admin". Thanks for the help! – BluJ IT Dec 20 '14 at 19:51
  • It did not work for me but then I saw I had another instance executing. I closed all instances and then started another one with administrator privileges and then tried again. Then it downloaded stuff that it did not download previously. So the access denied message is probably misleading, probably the files were just not downloaded. – user34660 Mar 11 '17 at 00:08
  • The same issue and solution applies for Xamarin with Visual Studio 2017. Thanks Will. – Wtower Dec 23 '18 at 09:13
35

I was getting a similar permission issue and SDK Manager could not download and install new components. Error message was (I'm running Android Studio (I/O Preview) 0.2.9)

"Unable to create C:\Program Files (x86)\Android\android-studio\sdk\temp"

Although solution was infact what @william-tate's answer says, I could not run the 'SDK Manager' directly. It fails with message:

Failed to execute tools\android.bat The system cannot find the file specified.

Instead I ran the 'tools\android.bat' as Administrator, which in turn launched SDK Manager with same permissions which fixed the issue.

Hope this helps for someone who faces the issue I faced.

BuddhiP
  • 5,711
  • 2
  • 30
  • 48
  • 2
    this is quite the helper for those who run the custom version with eclipse in it. – EmilDo Feb 03 '14 at 20:49
  • 4
    It's also helpful for those who literally don't see the android sdk manager exe in the sdk folder. – whyoz Apr 29 '14 at 17:29
19

In Mac OS X (tried with Android Studio), do the following in Terminal

cd /android/adt-bundle-mac-x86_64/sdk/tools 
sudo ./android sdk

This launches SDK manager as admin. Now update/install the packages from SDK manager and it'll work.

v01d
  • 539
  • 6
  • 10
10

For Android Studio, selecting "Run As Administrator" while starting Android Studio helps.

jimmy0251
  • 15,313
  • 10
  • 33
  • 38
8

In my case I had to specify proxy settings in Tools->Options.

Alex Isayenko
  • 649
  • 8
  • 7
3

I had same problem when I try to install it on my pc (Win7, 64-bit system). I had an error message shown in figure below. But when I check my local folder 'C:\Users\username\AppData\Local\Android\sdk', the Android SDK is already there. Somehow Android studio could not see/link it.

So please check first whether you can find the Android SDK in the local folder. If yes, just follow the next steps.

  1. Chose 'Cancel' and click on 'X' on the top right corner. enter image description here
  2. Chose 'Do not re-run the setup wizard' and click 'OK' enter image description here
  3. Start Android Studio again and go 'Configure'-->'Project Defaults' --> 'Project Structure' enter image description here
  4. Add 'C:\Users\username\AppData\Local\Android\sdk' to 'Android Location' and click 'OK' List item
  5. Click on 'Start a new Android Studio project'.

Hopefully it helps.

Diiiiii
  • 489
  • 5
  • 9
2

I had a similar issue - very slow xml downloads followed by an empty package list. The SDK, it seems, was trying to use legacy Java installation. Setting the JAVA_HOME to the 1.6 jdk did the trick.

Eglin
  • 553
  • 5
  • 10
2

In my case I was using Windows 7 with the 64-bit OS. We installed the 64-bit Java SE and 64-bit ADT Bundle. With that set up, we couldn't get the SDK manager to work correctly (specifically, no downloads allowed and it didn't show all the API download options). After trying all of the above answers and from other posts, we decided to look into the Java set up and realized it might the 64-bit configuration that's giving the ADT bundle grief (I vaguely recall seeing/reading this issue before).

So we uninstalled Java 64-bit and reinstalled the 32-bit, and then used the 32-bit ADT bundle, and it worked correctly. The system user was already an admin, so we didn't need to "Run as Administrator"

Gene Bo
  • 8,869
  • 6
  • 70
  • 118
2

For those running SDK Manager in Eclipse, selecting "Run As Administrator" while starting Eclipse.exe helps.

alextc
  • 2,317
  • 7
  • 44
  • 80
2

The Access denied is because Windows doesn't give the default write and modify permission to the files in its install drive viz. c: To resolve this issue I usually use a separate drive or in your case, you need to set the access rights to the specific folder in the options right click -> options > security -> edit enter image description here

Madhu Kumar
  • 324
  • 2
  • 10
1

In windows 8:

  • right click on windows button
  • List item
  • CDM as administrator
  • Press 'yes'
  • paste this $ C:\xxx\xxx\AppData\Local\Android\sdk\tools\android.bat
TigerSpirt
  • 161
  • 1
  • 11
1

For Linux/ubuntu User

  • Why it's happening?
    due to lock icon on some folder(not having read/write access) in
    "/yourpath/android-studio-SDK"

  • Sort and sweet solution
    -Open Terminal (Ctrl +alt +t)
    -copy pest sudo chown -R $USER: $HOME
    -wait for a while.....
    -now Try again to update your SDK

Happy Coding :)

Vishal Patel
  • 2,865
  • 2
  • 21
  • 54
0

If you use SDK Manager in Eclipse:

Option 1: Right-click on eclipse.exe and select "Run As Administrator".

Option 2: If you don't want to start Eclipse.exe as Administrator just install/copy Eclipse installation files from "C:\program files\Eclipse ADT Bundle\" to some unprotected folder, like "D:\android\". Run "D:\android\eclipse\eclipse.exe", select menu item "Window => Preferences => Android" and change "SDK Location" to "D:\android\sdk\". After that you'll be able to install new packages in Android SDK Manager.

Vadim Guzev
  • 320
  • 2
  • 12
0

go to sdk folder and right click on SDK manager and run with administrator and enjoy installing.

Dipankar Baghel
  • 1,596
  • 1
  • 9
  • 21
0

To go along with what v01d said:

Using Android Studio for Mac OS X, the SDK folder could also be at /Users/{user}/Library/Android/sdk, where {user} is your username.

To find out where the partial SDK installation is, go to Configure > SDK Manager in Android Studio, then click edit at the top. This should pop up a window and show the location.

Copy this path and paste it front of the cd command in a terminal. Finally execute sudo ./android sdk to launch the standalone SDK manager.


EDIT (July 14, 2016):

The "android" binary file could also be at /Users/{user}/Library/Android/sdk/tools.

BLiu1
  • 65
  • 1
  • 6
0

Solution for macOS

  1. click right on AndroidStudio.app -> show Package Contents -> MacOS
  2. now drag & dropping the studio-executable in a terminal
  3. sudo! (Ctrl+A places your cursor in front)
  4. start the SDK Manager inside AS to get your stuff (you will have root access)

https://www.youtube.com/watch?v=ZPnu3Nrd1u0&feature=youtu.be

Martin Pfeffer
  • 11,627
  • 8
  • 54
  • 64
0

you need 3 steps:

1- Configure -> "Appearance and Behavior" -> System Settings -> HTTP Proxy. I selected "Automatic proxy configuration url:"

2-Delete your ~/.Android* folders (c:\users\ur user). 3-Run Android Studio. It will show you a welcome wizard where it tries to download the SDK again.

Ghadir Farzaneh
  • 149
  • 1
  • 3