Regex Rookie
Regex Rookie

Reputation: 10662

Failed to rename directory tools to temp\ToolPackage.old01 in C:\android-sdk-windows

When trying to upgrade Android SDK Tools to revision 16, I am getting the following error:

Failed to rename directory C:\android-sdk-windows\tools to C:\android-sdk-windows\temp\ToolPackage.old01.

Done. Nothing was installed.

enter image description here

Nothing I try to do, including providing FULL permissions (in addition to the special permissions it already had) to Administrator, helps.

Also, I don't know of anything that is accessing those directories.

How do I fix this problem?

Upvotes: 33

Views: 40951

Answers (14)

MrSalesi
MrSalesi

Reputation: 394

Right click on "android-sdk" folder > properties > security > set full control permission for "ALL APPLICATION PACKAGES" and press OK, it take some minutes for sett this permission in all sub directories.

Upvotes: 0

Will Tate
Will Tate

Reputation: 33509

This is how I fixed it in Windows 7:

Make a copy of the \tools folder, name it something like \copy. So you should have c:\android-sdk-windows\copy. Now run android.bat from the \copy folder with Admin privileges. This should prevent the issue with items currently being open in the \tools folder.

Upvotes: 68

exa42
exa42

Reputation: 91

Had the same issue with that and even tried with the copied folder. I had to run adb kill-server in the command prompt in the platform-tools directory for it to continue.

Upvotes: 7

Roman Nazarevych
Roman Nazarevych

Reputation: 7703

For me this problem was solved by running SDK Manager with administrator privileges

Upvotes: 6

ultraon
ultraon

Reputation: 2400

i have another solution, that helped me. 1. When you got error message in SDK Manager, copy zip file (name contains version and 'tools' word) from sdk/temp folder; 2. Exit from SDK Manager; 3. Unzip archive from first item, you got new tools, and replace sdk/tools with new one; 4. Clean sdk/temp folder;

Upvotes: 0

Haitham Sweilem
Haitham Sweilem

Reputation: 1783

I ran into the same problem.

Most probably, you have a project opened in Eclipse (or android studio), and this project uses files that the SDK manager is trying to access or update.

So, the project is reading from some SDK platform folders/files, and the SDK manager is trying to overwrite it at the same time (for updating).

This is why you do not have permissions, not because you are not administrator.

Try closing Eclipse, click 'YES' in the SDK manager warning message (or re-run SDK manager again while Eclipse is not running).

Upvotes: 2

Christian García
Christian García

Reputation: 4009

For me, it worked by simply deleting the contents of the temp directory in the SDK installation folder (C:\android-sdk-tools\temp in your case)

Upvotes: 9

arniotaki
arniotaki

Reputation: 2265

For me who I tried all the previous solutions and didn't work I solved my problem with the following sugestion (#16) on the link: https://code.google.com/p/android/issues/detail?id=4410 which is:

  1. Find the "temp" folder and you can find the "tools_r05-windows.zip" or other files which you will update.
  2. unzip it.
  3. here you will find the "tools_r05-windows" and copy all the files in the file. which should be updated file
  4. copy to the "tools" folder.
  5. OK.

Upvotes: 3

yarian
yarian

Reputation: 6032

For anyone who is having this issue on OS X, sudo chown -R $USER worked for me (on your android-sdk directory).

Upvotes: 1

docpkd
docpkd

Reputation: 551

In addition to the instructions given here by William, make sure you first delete the temp folder in the sdk folder. If it already exists, sometimes even creating a copy of the tools folder does not work. Therefore:

  1. Delete the sdk\temp folder.
  2. Create a copy of the sdk\tools folder as sdk\copy
  3. Run android.bat which is inside the copy folder, from a command prompt, with admin privileges. This will start the SDK manager
  4. Update the sdk as you normally do when the SDK manager starts.
  5. Delete the sdk\copy folder

Upvotes: 0

nonozor
nonozor

Reputation: 934

You can run SDK Manager outside eclipse directly from the androidSDK directory.

Upvotes: 0

Sid
Sid

Reputation: 141

I encounter this problem while adding compatibility package to project in eclipse.

I solved this issue by opening the eclipse with administrator privileges.

In Windows 7: Right click on eclipse.exe Run as administrator.

To make eclipse.exe to run as administrator always

Right click on eclipse.exe --> Properties -->Compatibility tab check the Run this program as an administrator check box under Privilege Level

Upvotes: 2

Abdurrahman Albaba
Abdurrahman Albaba

Reputation: 1

Press ctrl + shift + esc to launch the task manager. Click on the Processes tab and sort the processes according to the command line column. Now search in the command line column for the same folder that contains /tools, click on it and click on End Process button. This will force all processes that use the same folder to be closed. Now open the SDK Manager again as administrator and it will work.

Upvotes: 0

user765418
user765418

Reputation:

I close the eclipse and run my android.bat (Path-To-YOUR-Android-SDK/tools/android.bat) from the command line.

It works for me

thanks

Upvotes: 1

Related Questions