安卓 安装 platforms 的时候报错--访问 url 出错
强制使用http 访问连接,并在hosts中添加地址,即可
问题描述
使用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
解决办法
由于某些众所周知又无法理解的原因,我们大陆使用Google的服务会出现种种问题,譬如Android开发也会出现阻碍。不过首先要说明的是一般情况下使用SDK Manager更新或者更新Eclipse的ADT插件是没有问题的,我以前也能正常更新,但是昨天不知道节点抽什么风,压根无法连接服务器,出现了上边的种种问题,下面说一下如果网络抽风的话应该如何解决问题。
第一种方法一劳永逸,直接配置VPN,但是现在想找个速度快又稳定还免费的VPN实在不易,尤其是更新SDK,以几kb/s的速度一个文件需要400多分钟,所以也就放弃了VPN。
另一种方法是使用http协议而不是https协议,因为https协议进行了加密处理,大陆因为无法审查,直接封死,而http协议则进行过滤处理,如果不访问乱七八糟的东西,更新个SDK还是没问题的。
在SDK Manager下Tools->Options打开了SDK Manager的Settings,选中“Force https://… sources to be fetched using http://…”,强制使用http协议。
而在更新ADT插件的时候则使用网址http://dl-ssl.google.com/android/eclipse,而不是https://dl-ssl.google.com/android/eclipse,这个在官方开发文档里也有介绍。
但是昨天的情况就是使用http协议也无法访问。
再说一个比较麻烦的方法,就是直接打开
https://dl-ssl.google.com/android/repository/addons_list.xml
https://dl-ssl.google.com/android/repository/repository.xml
https://dl-ssl.google.com/android/repository/addon.xml
这几个文件,找到你要下载的文件名,直接用迅雷下载,ADT可以直接在官网下载ADT包进行安装。具体方法自己搜索。
最好的方法还是改hosts文件的方法,更新速度较快。Windows在C:\WINDOWS\system32\drivers\etc目录下,Linux用户打开/etc/hosts文件。
打开文件后添加以下内容。
#Google主页
203.208.46.146 www.google.com
#这行是为了方便打开Android开发官网 现在好像不FQ也可以打开
74.125.113.121 developer.android.com
#更新的内容从以下地址下载
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
添加以上的网址,再选用http协议,就可以正常的进行更新了。
或者也可以什么都不做,过上一两天可能会恢复正常。
下边贴上使用Google各种服务在修改hosts文件时需要添加的内容。
#Google Service
#Chrome 网上应用
203.208.46.146 chrome.google.com
203.208.46.146 clients0.google.com
203.208.46.146 clients1.google.com
203.208.46.146 clients2.google.com
203.208.46.146 clients3.google.com
203.208.46.146 clients4.google.com
203.208.46.146 www.googleusercontent.com
203.208.46.146 lh0.googleusercontent.com
203.208.46.146 lh1.googleusercontent.com
203.208.46.146 lh2.googleusercontent.com
203.208.46.146 lh3.googleusercontent.com
203.208.46.146 lh4.googleusercontent.com
203.208.46.146 lh5.googleusercontent.com
203.208.46.146 lh6.googleusercontent.com
203.208.46.146 clients1.googleusercontent.com
203.208.46.146 clients2.googleusercontent.com
#网页快照
203.208.46.146 webcache.googleusercontent.com
#Google SSL
203.208.46.146 encrypted.google.com
203.208.46.146 encrypted.google.com.hk
#Google Docs
203.208.46.146 docs.google.com
203.208.46.146 docs0.google.com
203.208.46.146 docs1.google.com
203.208.46.146 docs2.google.com
203.208.46.146 docs3.google.com
203.208.46.146 spreadsheets.google.com
203.208.46.146 spreadsheets0.google.com
203.208.46.146 spreadsheets1.google.com
203.208.46.146 spreadsheets2.google.com
203.208.46.146 spreadsheets3.google.com
#Gmail
203.208.46.146 mail.google.com
203.208.46.146 chatenabled.mail.google.com #Gmail中Gtalk聊天服务
#Google 搜索
203.208.46.146 www.google.com
#Google preview
203.208.46.146 www.googlepreview.com
#Google 翻译
203.208.46.146 translate.google.com
203.208.46.146 translate.googleapis.com
#Google 搜索建议(IE9)
203.208.46.146 clients5.google.com
#Google Code
203.208.46.146 code.google.com
#Picasa 网络相册
203.208.46.146 picasaweb.google.com
203.208.46.146 lh0.ggpht.com
203.208.46.146 lh1.ggpht.com
203.208.46.146 lh2.ggpht.com
203.208.46.146 lh3.ggpht.com
203.208.46.146 lh4.ggpht.com
203.208.46.146 lh5.ggpht.com
203.208.46.146 lh6.ggpht.com
203.208.46.146 lh7.ggpht.com
203.208.46.146 lh8.ggpht.com
203.208.46.146 lh8.ggpht.com
203.208.46.146 lh9.ggpht.com
203.208.46.146 lh6.google.com
#Google 个人资料
203.208.46.146 profiles.google.com
203.208.46.146 browsersync.google.com
#Google+
203.208.46.146 talkgadget.google.com #Google+中的聊天服务
203.208.46.146 ssl.gstatic.com
203.208.46.146 images-pos-opensocial.googleusercontent.com
203.208.46.146 images1-focus-opensocial.googleusercontent.com
203.208.46.146 images2-focus-opensocial.googleusercontent.com
203.208.46.146 images3-focus-opensocial.googleusercontent.com
203.208.46.146 images4-focus-opensocial.googleusercontent.com
203.208.46.146 images5-focus-opensocial.googleusercontent.com
203.208.46.146 images6-focus-opensocial.googleusercontent.com
203.208.46.146 plus.google.com
#Download 下载
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
#Groups
203.208.46.146 groups.google.com
#Google URL Shortener
203.208.46.146 goo.gl
#Google App Engine
203.208.46.146 appengine.google.com
#Android Developer
74.125.113.121 developer.android.com
安卓 安装 platforms 的时候报错--访问 url 出错的更多相关文章
- ROS的安装-> rosdep init /update报错2022.02.24实测有效
ROS的安装-> rosdep init /update报错2022.02.24实测有效 一. 解决rosdep_init问题 正常执行sudo rosdep init会报错,如下: ERR ...
- 安装J2EE的SDK报错:could not find the required version of the Java(TM)2 Runtime Environment in '(null)'的解决办法。
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- 安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined
安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined 出现这种错误是因为主机名和/etc/host ...
- npm不能安装任何包,报错:npm WARN onload-script failed to require onload script npm-autoinit/autoinit及解决方法
想要利用Hexo搭建一个博客,但是安装时npm一直报错,不仅仅是Hexo包,连别的其他包也不行,会提示下面的一堆错误 npm WARN onload-script failed to require ...
- 关于在centos7上安装vmtools的各种报错的问题处理
基本上如果安装vmtools时报错的错,首先记录一下报错信息 例如,本次遇见的就是 /tmp/modconfig-8mD7iy/vmhgfs-only/page.c:1625:23: 错误:提供给函数 ...
- 安装mongodb后启动报错libstdc++
安装mongo后启动报错如下图 显然说是libstdc++.so文件版本的问题,这种一般都是gcc版本太低了 接着查询gcc的版本 strings /usr/lib/libstdc++.so.6 ...
- 解决小米手机USB安装apk时AS报错:INSTALL_FAILED_USER_RESTRICTED
今天,直接用AS在小米手机上运行安装的时候总是报错:INSTALL_FAILED_USER_RESTRICTED,于是乎,通过以下方式解决: 在开发者选项将USB安装打开,然后,哈,解决了.记录一下.
- 安装vue-cli时-4058报错的解决方法
一.报错信息 安装vue-cli时-4058报错 二.解决办法 1.安装淘宝镜像 npm --registry https://registry.npm.taobao.org info undersc ...
- [原]在使用ubuntu14.04,安装devstack的时候报错./stack.sh: line 463: generate-subunit: command not found
=======在使用ubuntu14.04,安装devstack的时候报错./stack.sh: line 463: generate-subunit: command not found 2016- ...
随机推荐
- centos磁盘爆满,查找大文件并清理
今天发现vps敲入crontab -e 居然提示 “Disk quota exceeded” 无法编辑.于是"df -h"查了查发现系统磁盘空间使用100%了.最后定位到是/var ...
- iOS:UIMapView地图视图控件的简单使用
可以通过设置MKMapView的mapViewType设置地图类型 MKMapTypeStandard 普通地图 MKMapTypeSatellite 卫星云图 MKMapTypeHybrid 普通 ...
- AppDomain 应用程序域
应用程序域 一.什么是应用程序域? 应用程序域 (application domain) (AppDomain) 一种边界,它由公共语言运行库围绕同一应用程序范围内创建的对象建立(即,从应用程序入口点 ...
- 获取sde 工作空间 propertys
// This example shows how to inspect and display different types of properties for a workspace. publ ...
- 如何在User版本开启串口(Uart),抓取上层Log,开启输入控制台
[原][FAQ03891] 如何在User版本开启串口(Uart),抓取上层Log,开启输入控制台 2014-11-26阅读1369 评论0 FAQ Content [Description]如何在U ...
- GMT and CST
GMT(Greenwich Mean Time) 代表格林尼治标准时间 而CST却同时可以代表如下 4 个不同的时区: Central Standard Time (USA) UT-6:00 C ...
- hibernate学习笔记4---HQL、通用方法的抽取实现
一.通用方法的抽取实现 由于hibernate中对增删改查的一切操作都是面向对象的,所以将增删改查抽取成通用方法,以满足不同的表的增删改查操作,简化jdbc代码. 具体例子如下: package cn ...
- JS获取系统的指定定年月日
/** * 获取系统当前时间 */ function getNowYearMouth(){ var date=new Date; var nowYearMouth=date.getMonth()+1; ...
- Toad
1. Toad 规矩: toad 不会违反, 限制, 扩大 你当前用户的权限, toad 不会影响你定义的关于instance的内容. 2. toad 可以执行大部分在 sql*plus 中执行的命令 ...
- non-overlapping-intervals
https://leetcode.com/problems/non-overlapping-intervals/ 其中还用到了Java的Comparator接口和其中的compare方法. packa ...