Can't upgrade Android SDK Tools

40,382

Solution 1

Extracted from here:

INSTRUCTIONS:

  1. make a copy of the tools directory and call this new directory tools2.
  2. DO NOT USE 'SDK Setup.exe'.
  3. Instead open up a cmd.exe window as administrator and run the following from this new tools2 directory (obviously the full path on your local machine will be different): J:\android-sdk-windows>tools2\android.bat update sdk

Basically, as noted before in this thread, 'SDK Setup.exe' invokes tools\android.bat, which makes it impossible for it to rename the tools directory thereafter. It's a bit goofy and should never have passed QA validation..

Solution 2

If you are unable to update Android SDK tools. Simply download the zip of android tools of version you want, and then replace the new tools directory with the old one. Then you are ready to go !!

Solution 3

Replace android.bat with latest version (r18). It should be zipped in android-sdk/temp

Worked for me.

Solution 4

Update SDK version using Eclipse (button Open the Android SDK Manager), running android.bat from a local copy of tools directory didn't work for me.

Solution 5

If none of above worked, try this:

  • Run task manager and close all java.exe instances.
  • Goto android-sdk-windows\temp and open tools_rXX.X-windows.zip ( replace X by latest version you've downloaded), now copy and replace it's content to tools folder.
Share:
40,382
zmbq
Author by

zmbq

Updated on July 09, 2022

Comments

  • zmbq
    zmbq almost 2 years

    I'm trying to upgrade the Android SDK tools from revision 15 to revision 16. The update fails, claiming that a "folder failed to be moved":

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

    I tried disabling my antivirus (as this problem has been reported by some people in 2009), and it didn't work. A fresh reboot didn't work, either. I'm encountering this problem on two different Windows 7 machines.

    I did not encounter this problem upgrading from previous revisions all the way up to revision 15.

    Anybody knows how I can circumvent this?

  • zmbq
    zmbq over 12 years
    How did I miss that? Thanks, I'll try it in a minute.
  • zmbq
    zmbq over 12 years
    Excellent! This worked! The Android team keeps unimpressing me, but there's nothing I can do about it.
  • LarsH
    LarsH over 10 years
    No doubt these instructions are successful in working around the problem, but I'm skeptical about the diagnosis of the cause. I had the same error message, and things started working fine for me after I opened up permissions on the sdk folder. Which means that invoking tools\android.bat was not the problem. Setups do vary over time, and maybe that was a problem at one point. But I would be reluctant to conclude that the developers made this particular goofy mistake that should never have passed QA.
  • not2qubit
    not2qubit over 10 years
    Well, as I said that's what happened to me, and there's no reason to down-vote someones findings for trying to help. I was doing it by Cygwin command line and THAT is what happened, period.
  • Dale Wilson
    Dale Wilson over 9 years
    @LarsH I got after installing Android Studio on a brand new machine following the instructions to the letter. I'd say "The developers made this particular goofy mistake." is an accurate statement. <humor> maybe it's an attempt to limit the number of Android developers to those who know about Stack Overflow </humor>
  • Dina
    Dina over 9 years
    This didn't work for me. I think it has to do with the ANDROID_SWT environment variable. Instead, you can simply download the latest tools from developer.android.com/sdk/index.html (at the bottom there's a link for downloading the SDK tools only)
  • ScottyC
    ScottyC over 7 years
    Just want to note, this solution also works on Unix (Linux and Mac OS X for page searchability) versions as well. Shell script is just called "android" with no extension. Thanks!