使用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解决禁止使用http协议的方案
  2. Android API开发之蓝牙开发之Android蓝牙开发GATT协议
  3. Android P(api28) 不支持 http 协议解决方法
  4. Android通过http协议POST传输方式(输出流提交到服务端)
  5. 微软的 Android 计划:邪恶的天才计划或只是邪恶?
  6. Andriod AOA协议通信总结
  7. Android 网络协议
  8. 【Android】HTTP协议的经典讲解
  9. Catalog Service - 解析微软微服务架构实例代码

随机推荐

  1. android 自动化压力测试-monkey 3 命令参
  2. Android实现将View保存成Bitmap的方法
  3. android仿探探图片拖拽功能
  4. android:intent 发送接收数据
  5. Android静态安全检测 -> 证书弱校验
  6. Android 实现图片加水印
  7. Android 运行ndk-build遇到的坑
  8. Widget分区域点击
  9. Android: VideoView做背景仿常见APP登录
  10. 加载大Bitmap处理资料集锦