Android: trouble updating to Android SDK Tools, re

2019-01-21 23:07发布

Currently I have Android SDK 2.1 (+ tools revision 4). I'd like to upgrade to Android SDK 2.2. When I try to do it I'm informed I need to upgrade Android SDK Tools to revision 7 first. So I agree, the process starts and then I get an error:

-= 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 or your anti-virus software.) Please momentarily deactivate your anti-virus software. Please also close any running programs that may be accessing the directory 'D:\Install\Programming\android-sdk-working-dir\android-sdk_r04-windows\android-sdk-windows\too!s'. When ready, press YES to try again.

Downloading Android SDK Tools, revision 7 Installing Android SDK Tools, revision 7

Failed to rename directory D:\Install\Programming\android-sdk-working-dir\android-sdk_r04-windows\android-sdk-windows\tools to D:\Install\Programming\android-sdk-working-dir\android-sdk_r04-windows\android-sdk-windows\temp\ToolPackage.old01.

I am aware of http/https and antivirus issues. So I disactivated my AV. I also closed any application that might hold a handle to the folder. Eclipse is also closed (I start the manager via command line). However I still get the same error.

Looks like the only app that can hold a handle to the folder is the manager itself, because its starting directory is the one the error complains about ('\tools').

I am on Win XP Pro + SP3. I run as admin.

Does anyone have an idea?

19条回答
来,给爷笑一个
2楼-- · 2019-01-21 23:14

Simply running "android.bat" (located in the tool folder) as admin worked fine in my case.

查看更多
Rolldiameter
3楼-- · 2019-01-21 23:15

None of these worked for me.

I modified the android.bat file in the scrap\ directory i had tried to update the original tools\ directory. I replaced the "%tools_dir%" with the the correct path (keeping the quotes).

call

%java_exe% -Dcom.android.sdkmanager.toolsdir="%tools_dir%" -Dcom.android.sdkmanager.workdir=%work_dir% -classpath "%jar_path%;%swt_path%\swt.jar" com.android.sdkmanager.Main %*

查看更多
倾城 Initia
4楼-- · 2019-01-21 23:17

In eclipse goto Window -> Android SDK and AVD manager and upgrade from there. Worked in my case.

查看更多
劫难
5楼-- · 2019-01-21 23:17

The trouble is java.exe which is locking the \tools folder. However java.exe is started by running SDK Manager itself. However when using the scrap method described above (ie running android.bat from \scrap folder) java.exe is NOT locking \tools nor scrap .

It just uses

C:\Users\<USERNAME>\AppData\Local\Temp\temp-android-tool .
查看更多
叼着烟拽天下
6楼-- · 2019-01-21 23:17

Like Jose, I was able to find a running process that had files open in the Tools folder, but in my case it was a previous version of the SDK Manager that had crashed. I used similar steps (on Windows 7) to find it :

Used the Process Explorer utility from Sysinternals as follows:

  1. execute Process Explorer
  2. Choose "Find File or DLL" and search for "tools"
  3. Double-click on the file listed located at tools folder
  4. At the bottom window right-mouse on file and choose "Close handle"
  5. Try again to continue with the installation

Cheers,

Johno!

查看更多
聊天终结者
7楼-- · 2019-01-21 23:18

i manually ran android.bat and I had to run as admin

查看更多
登录 后发表回答