Failed to move away or delete existing target C:\androidSDK\sdk\tools

穿精又带淫゛_ 提交于 2019-12-24 08:56:06

问题


i can't update the sdk tools, i don't know why, if use this command "sdkmanager --update" or "android update sdk" it will give me error like this title :

Warning: An error occured during installation: Failed to move away or delete existing target file: C:\androidSDK\sdk\tools

big thanks if you can help me!


回答1:


1) Rename C:\Users\%username%\AppData\Local\Android\Sdk\tools folder to tool

2) Navigate to cd C:\Users\%username%\AppData\Local\Android\Sdk\tool\bin in cmd

3) And run sdkmanager --update --verbose, will create a new folder tools

4) Run flutter doctor --android-licenses

5) Then Accept the android licenses by clicking y

6) flutter doctor command will show the following:

Kishore Kumar@Kishore MINGW64 ~$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.7.3, on Microsoft Windows [Version 10.0.17134.228], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 25.0.2)
[√] Android Studio (version 3.1)
 X Flutter plugin not installed; this adds Flutter specific functionality.
 X Dart plugin not installed; this adds Dart specific functionality.
[√] Connected devices (1 available)
 • No issues found!



回答2:


Here is how i solved this problem:

First, I renamed AndroidSDK\tools to AndroidSDK\tool.

Then, I set the windows' environment variable Path from AndroidSDK\tools to AndroidSDK\tool (maybe not necessary)

Run sdkmanager --update in tool\bin .

Ignore the warning and wait until the update is done.

There will be a new folder named tools in AndroidSDK.

Copy all the files in tools folder and paste them to tool folder.

Overlay all the files that which has the same name in tool folder.

Finally,delete tools folder and rename tool to tools.

Problem solved.



来源:https://stackoverflow.com/questions/49306527/failed-to-move-away-or-delete-existing-target-c-androidsdk-sdk-tools

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!