Android SDK三种更新失败及其解决方法
Android SDK三种更新失败及其解决方法
发布时间:2016-12-28 来源:查字典编辑
摘要:最近在网上看Moto360的图片,真是帅,帅了又帅,比帅更帅。所以想研究下Androidwear。更新AndroidSDK,居然失败了三次。...

最近在网上看Moto 360的图片,真是帅,帅了又帅,比帅更帅。所以想研究下Android wear。

Android SDK三种更新失败及其解决方法1

更新Android SDK,居然失败了三次。

1.第一次失败

出现Failed to fetch URL错误提示

Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-6.xml, reason: Connection to https://dl-ssl.google.com refused Failed to fetch URL http://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: Connection to http://dl-ssl.google.com refused Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: hostname in certificate didn't match: != 更新ADT时无法解析https://dl-ssl.google.com/android/eclipse

解决办法

打开C:WindowsSystem32driversetc文件夹,将hosts文件复制到桌面,用文本编辑软件(如Subline Text2)打开hosts文件。增加一行:74.125.237.1 dl-ssl.google.coms

Android SDK三种更新失败及其解决方法2

修改好之后,将修改了的hosts文件替换C:WindowsSystem32driversetc文件夹下的hosts文件。

2.第二次失败

将hosts文件修改后,满心欢喜地发现出现了新的API,传说中的Android L。安装更新,也有速度。可是下载途中出现了如下的错误提示:

Android SDK三种更新失败及其解决方法3

Download interrupted:Unexpected HTTP Status:500

下载中断,意想不到的HTTP状态:500。Google了一下,发现是服务器端的问题。

解决办法:

首先下载zym,这是一个代理服务器软件。如下,代理地址为127.0.0.1,端口号为8580。

Android SDK三种更新失败及其解决方法4

然后点击Android SDK Manager的tools选项,选择Settings。将HTTP代理服务器地址设为上面那个软件的127.0.0.1,代理端口设为8580。勾选强制使用https://代替http://。

Android SDK三种更新失败及其解决方法5

最后,大功告成。

Android SDK三种更新失败及其解决方法6

3.第三次失败

居然又失败了,虽然SDK能下载,但是最后一个包都没有安装成功。见下图。

Android SDK三种更新失败及其解决方法7

简直坑爹,Google了一下,在StackOverFlow上看到了同样的问题。

解决办法

同样的,Android SDK Manager,依次点击tools,Settings,Clear Cache。如下

Android SDK三种更新失败及其解决方法8

Oh yes!成功更新!!!

Android SDK三种更新失败及其解决方法9

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新安卓软件开发学习
热门安卓软件开发学习
编程开发子分类