Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot upgrade Android SDK

I have closed every window, restarted the computer. But Eclipse is telling me: "C:\Program Files\android-sdk\tools is being accessed....I even deleted the directory but I still get : how to fix?

Failed to rename directory C:\Program Files\Android\android-sdk\platform-tools to C:\Program Files\Android\android-sdk\temp\PlatformToolPackage.old01.

like image 529
hunterp Avatar asked Aug 08 '11 21:08

hunterp


2 Answers

I have had this problem on Windows too. Instead of updating it through Eclipse, try the stand-alone option:

  1. Close Eclipse
  2. Open a Command Prompt window (ideally in Administrator mode)
  3. Run the command "android"

If you have the SDK tools directory in your path it will open the same UI you get in Eclipse but without additional file locking. If it is not in your path have a look in C:\Program Files\Android\android-sdk\tools and run "android.bat" from there.

Also, once you have updated the SDK, don't forget to fire up Eclipse and, on the Help menu, click "Check for Updates". You may well find the ADK Eclipse plugin needs to be updated too - this often goes in step with SDK updates.

like image 82
Mark Roberts Avatar answered Sep 30 '22 04:09

Mark Roberts


Supposedly, if you use the SDK Manager.exe program rather than tools\android.bat, it works. However, I've never had any luck with that.

My traditional approach has been:

  • Duplicate the tools\ directory to create a foo\ directory
  • Adjust your PATH and other environment variables to point to foo\
  • Run the tools\android.bat out of foo\
  • Do the upgrade, which should work
  • When done, close out of the SDK and AVD Manager, revert your PATH and such to point back to tools\, and get rid of the foo\ directory
like image 34
CommonsWare Avatar answered Sep 30 '22 06:09

CommonsWare