Recently when I tried to update Android SDK to latest version i.e 2.2, API 8, revision 2 from eclipse, I got a warning on the lines below

Failed to rename directory

-= Warning ! =-

A folder failed to be renamed or moved. On Windows this typically means that a program is using that folder (for example Windows Explorer.) Please close all running programs that may be locking the directory.

Many people have reported this error and though there are various solutions (like renaming the tools folder under <Android_Installation_Path>\android-sdk-windows\tools and update from that folder etc), there is no single solution that fixed this bug.

Ther bug is also reported in the code.google.com

http://code.google.com/p/android/issues/detail?id=4410#makechanges

The core issue is indeed somebody else locked the tools folder. So I tried the following solution and it worked like charm

  • Close Eclipse and close all instances of windows explorer in which the <Android_Installation_Path>\android-sdk-windows\tools folder was opened
  • Now run the AVD Manager independently as follows
  • Open a command prompt.
  • Go to the directory where android sdk is installed at, and then its tools subdirectory.
  • Run Android.bat.
  • At this point, update just as you would if you were running the AVD Manager from within Eclipse (make sure the proxy settings are mentioned if you are behind the proxy).

You should be able to update the Android SDK now.