使用SDK Manager更新时出现问题 Failed to fetch URLhttps://dl-ssl.google.com/android/repository/repository-6.xml, reason: Connection tohttps://dl-ssl.google.comrefused Failed to fetch URLhttp://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: Connection tohttp://dl-ssl.google.comrefused Failed to fetch URLhttps://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


可以用以下办法解决:

由于某些众所周知又无法理解的原因,我们大陆使用Google的服务会出现种种问题,譬如Android开发也会出现阻碍。一种方法是使用http协议而不是https协议,因为https协议进行了加密处理,大陆因为无法审查,直接封死,而http协议则进行过滤处理,如果不访问乱七八糟的东西,更新个SDK还是没问题的。

解决方法如下:

1.ADT更新

更新ADT插件的时候则使用网址http://dl-ssl.google.com/android/eclipse,而不是https://dl-ssl.google.com/android/eclipse,这个在官方开发文档里也有介绍。 但是昨天的情况就是使用http协议也无法访问。对于ADT还是建议手动下载。

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文件。

使用以下工具修改host:http://blog.csdn.net/scry5566/article/details/44223323


更多相关文章

  1. Android(安卓)Studio 3.2.1找不到Android(安卓)Device Monitor
  2. 使用外部下载工具下载 Android(安卓)SDK
  3. 在服务器上使用 gradle 打包 android 源码
  4. android在service中使用AsyncHttpClient加载网络资源
  5. EditText
  6. Android(安卓)使用Telephony API
  7. 最常用的GitHub—— Android(安卓)开源项目整理(精品)
  8. Android(安卓)TextView跑马灯抖动问题
  9. GridView, ListView 区别

随机推荐

  1. Android将两个bitmap合并
  2. Android(安卓)解析 json
  3. Android学习-使用ViewFlipper实现屏幕切
  4. Android(安卓)适配器Adapter的学习
  5. 解开Android应用程序组件Activity的"sing
  6. 分享给大家一些高质量的资源
  7. 实战Android应用开发
  8. 如何在Android(安卓)studio中以compile直
  9. Android(安卓)VideoVIew 视频全屏拉伸
  10. ActiveAndroid--Android轻量级ORM框架