ADT在线安装与更新

来源:互联网 发布:cad for mac 编辑:程序博客网 时间:2024/04/29 00:02
以往安装ADT根本就不是个问题,可是现在就是个大问题了。
<span style="font-family: 微软雅黑; font-size: 15px; line-height: 24px;"><strong> https://dl-ssl.google.com/android/eclipse</strong></span>
<span style="font-family: 微软雅黑; font-size: 15px; line-height: 24px;"><strong></strong></span><pre id="best-answer-content" class="reply-text mb10" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: Arial; zoom: 1;"><span style="font-family: 微软雅黑; font-size: 15px; line-height: 24px;"><strong> http://dl-ssl.google.com/android/eclipse</strong></span>
都无法正常访问,会提示android ADT Unable to connect to repository http://dl-ssl.google.com/android/eclipse/content.xml 
<span style="font-family: arial; line-height: 18px; font-size: 12px;">问题描述二:使用SDK Manager更新时出现问题Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-6.xml, reason: Connection to https://dl-ssl.google.com refusedFailed to fetch URL http://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: Connection to http://dl-ssl.google.com refused</span>
<span style="font-family: 微软雅黑; font-size: 15px; line-height: 24px;"><strong><span style="font-family: arial; line-height: 18px; font-size: 12px;">刚开始,还以为是eclipse版本的问题适应不了新的ADT版本,试了几个版本之后发现根本不是。</span></strong></span>
<span style="font-family: Arial; line-height: 22px;">很明显,国内网络和谐掉了google这个服务器,可以强制指向下Hosts ----</span><span style="line-height: 20px; font-size: 10px; font-family: SimSun;">澳大利亚Google公司澳大利亚悉尼数据中心的IP地址</span><span style="font-family: Arial; line-height: 22px;">,以下是添加内容:</span>
<span style="font-family: Arial; line-height: 22px;">#Google主页203.208.46.146 www.google.com#这行是为了方便打开Android开发官网 现在好像不翻墙也可以打开74.125.113.121 developer.android.com#更新的内容从以下地址下载203.208.46.146 dl.google.com</span>
<span style="font-family: Arial; line-height: 22px;">203.208.46.146 dl-ssl.google.com</span>
<span style="font-family: Arial; line-height: 22px;"></span><pre id="best-answer-content" class="reply-text mb10" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; line-height: 22px; padding: 0px; zoom: 1;"><span style="font-family: Arial;">#74.125.237.1 dl-ssl.google.com  或者采用这个</span>
具体操作方式:目录:c:\windows\system32\drivers\etc下 找到hosts文件,其实是一个纯文本的文件,Linux用户打开/etc/hosts文件。1、用记事本打开2、将:74.125.237.1 dl-ssl.google.com 添加至hosts文件最后一行3、保存关闭Hosts,重新启动eclipse4.启动Eclipse,菜单点击进入Help -> Install New Software,在出现的窗口中点击Add按钮,然后在Name中输入你自定义的名称,Location中输入:

http://dl-ssl.google.com/android/eclipse

如果不行可以用https://........ 而不是http://..........反正多试一下吧

特别注意更新ADT的时候使用http协议而不是https协议,因为https协议进行了加密处理,大陆因为无法审查,直接封死,而http协议则进行过滤处理,如果不访问乱七八糟的东西,操作步骤:

在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,这个在官方开发文档里也有介绍。

我们知道在网络上访问网站,要首先通过DNS服务器把网络域名(www.域名.com)解析成xxx.XXX.XXX.XXX的IP地址后,我们的计算机才能访问。要是对于每个域名请求我们都要等待域名服务器解析后返回IP信息,这样访问网络的效率就会降低,而Hosts文件就能提高解析效率。根据Windows系统规定,在进行DNS请求以前,Windows系统会先检查自己的Hosts文件中是否有这个地址映射关系,如果有则调用这个 IP地址映射,如果没有再向已知的DNS服务器提出域名解析。也就是说Hosts的请求级别比DNS高。 74.125.237.1 是澳大利亚Google公司澳大利亚悉尼数据中心的IP地址,这个地址没有被墙,所以利用Hosts将美国google官方的android adt 下载服务器将制映射到澳大利亚google中心,这样就可以了。
                                             
0 0