While trying to update my Android SDK I am encountering this error when trying to install this particular package:
I had to make a copy of the tools folder itself (keeping it at the same directory tree level, thus "tools" and "tools-copy" were both in the "android-sdk-windows" folder). Then ran Android.bat from that copy.
After the update just delete the tools-copy folder.
If you launched the SDK Manager from Android Studio then all you need to do is close Android Studio.
I presumed the SDK Manager was a modal dialog that was part of Android Studio - not a separate program.
Ensure you don't have any essential files or folder opened/being used by other applications including explorer.
Solved this on my side by killing the adb.exe in Task Manager.
This happens once in a while on my Windows SDK (even when I don't have any antivirus or similar programs running, execute the SDK-Manager as an administrator and so on).
I just update the tools by hand in this case. Which means close the SDK-Manager after the error and open the ANDROID_SDK\temp
folder. There should be a zip named tools_R16.zip
or similar (don't remember the exact name). Unzip that. You should end up with a tools
folder. Copy all the files from this folder into ANDROID_SDK\tools
. Overwrite when asked. And take a backup of the SDKs tools folder beforehand, just in case something explodes.
After that, start the SDK-Manager again. The tools version should be updated.
The error message was Failed to rename directory C:\devtools\android-sdk\system-images\android-21\google_apis\x86 to C:\devtools\android-sdk\temp\SystemImagePackage.old01
. I deleted the C:\devtools\android-sdk\temp\SystemImagePackage.old01 directory by hand (it was a leftover? I don't know) and it was able to proceed.