【android 开 发 】 - Android Studio 导入项目 出现安装Error:Cause: failed to find target with hash string 'and...

今天 在导入 一个新项目时 ; 出现了这个错

<pre name="code" class="plain" style="color: rgb(0, 0, 0); font-family: "Courier New"; font-size: 12px; margin: 5px 8px; padding: 5px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">Error:Cause: failed to find target with hash string 'android-23' in: C:\Users\Administrator\AppData\Local\Android\sdk
Open Android SDK Manager</pre>

一 、于是 点击Open Android SDK Manager ; 想更新下android studio 下的 sdk ;

无奈出现了这个错误:

image

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目录设为只读

image

,导致程序启动更新SDK要写入Temp目录时出错。

将Temp目录的只读属性去掉, 右键此文件,将只读的勾选去掉即可!,

重启Android Studio后 SDK就更新成功

然后 还是找不到

<pre name="code" class="plain" style="color: rgb(0, 0, 0); font-family: "Courier New"; font-size: 12px; margin: 5px 8px; padding: 5px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">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一下也行!)。

</pre>

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容