Android SDK Manager更新不了,出现错误提示:"Failed to fetch URL..."! android
能够用如下办法解决: windows
使用SDK Manager更新时出现问题 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: <dl-ssl.google.com> != <www.google.com> 更新ADT时没法解析https://dl-ssl.google.com/android/eclipse eclipse
因为某些众所周知又没法理解的缘由,咱们大陆使用Google的服务会出现种种问题,譬如Android开发也会出现阻碍。一种方法是使用http协议而不是https协议,由于https协议进行了加密处理,大陆由于没法审查,直接封死,而http协议则进行过滤处理,若是不访问乱七八糟的东西,更新个SDK仍是没问题的。 fetch
解决方法以下: google
1. ADT更新 加密
更新ADT插件的时候则使用网址http://dl-ssl.google.com/android/eclipse,而不是https://dl-ssl.google.com/android/eclipse,这个在官方开发文档里也有介绍。 可是昨天的状况就是使用http协议也没法访问。对于ADT仍是建议手动下载。 spa
2. SDK更新
1) 在SDK Manager下Tools->Options打开了SDK Manager的Settings,选中“Force https://… sources to be fetched using http://…”,强制使用http协议。
2) 而后改hosts文件。Windows在C:\WINDOWS\system32\drivers\etc\hosts目录下,Linux用户打开/etc/hosts文件。打开文件后添加如下内容。
203.208.46.146 www.google.com
74.125.113.121 developer.android.com
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
注意:在windows上没法修改hosts文件,你能够先拷贝到桌面,修改好了之后,在覆盖系统文件,就能够了
插件