今天 在導入 一個新項目時 ; 出現了這個錯
Error:Cause: failed to find target with hash string 'android-23' in: C:\Users\Administrator\AppData\Local\Android\sdk Open Android SDK Manager
一 、於是 點擊Open Android SDK Manager ; 想更新下android studio 下的 sdk ;
無奈出現了這個錯誤:
Loading SDK information...
Installing Archives:
Preparing to install archives
Installing SDK Platform Android 6.0, API 23, revision 2
Failed to rename directory C:\Users\Administrator\AppData\Local\Android\sdk\platforms\android-23 to C:\Users\Administrator\AppData\Local\Android\sdk\temp\RemotePlatformPkgInfo.old01.
SDK Manager: failed to install
-= Warning ! =-
A folder failed to be 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 or close any running programs that may be accessing the directory 'C:\Users\Administrator\AppData\Local\Android\sdk\platforms\android-23'.
When ready, press YES to try again.
Note: you can use --force to override to yes.
[y/n] =>
Done. Nothing was installed.
二 、使用百度翻譯 哈哈:意思是。
加載SDK的信息…
安裝檔案:
准備安裝檔案
安裝SDK平台Android 6,API 23,修訂2
無法重命名目錄C:\用戶\管理員\ AppData \地方\ Android SDK \平台\ android-23 C:\用戶\管理員\ AppData \地方\ \溫度\ remoteplatformpkginfo.old01 Android SDK。
SDK管理器:安裝失敗
•警告!=—
無法移動文件夾。在窗口中,這通常意味着一個程序是使用該文件夾(例如窗口資源管理器或您的反病毒軟件)。
請暫時關閉你的殺毒軟件或者關閉所有正在運行的程序,可以訪問目錄C:\用戶\管理員\ AppData \地方\ Android SDK平台android-23 \ \”。
准備好后,請按“是”再試。
注:你可以使用武力來替代是。
[和] =
完成. 沒有安裝。
在網上找了下方案
三 、解決方法:
C:\Users\Administrator\AppData\Local\Android\sdk\temp
這個目錄是Andriod Studio安裝程序自建的,安裝程序后把SDK下的Temp目錄設為只讀
,導致程序啟動更新SDK要寫入Temp目錄時出錯。
將Temp目錄的只讀屬性去掉, 右鍵此文件,將只讀的勾選去掉即可!,
重啟Android Studio后 SDK就更新成功
然后 還是找不到
Error:Cause: failed to find target with hash string 'android-23' in: C:\Users\Administrator\AppData\Local\Android\sdk Open Android SDK Manager 再次重啟Android Studio 后 ,項目便可以正常使用了!(貌似感覺 ReBulid一下也行!)。