«

解决Android SDK下载和更新失败的方法详解

时间:2024-3-2 18:20     作者:韩俊     分类: Android


http://blog.csdn.net/singleton1900/article/details/12911333

今天更新sdk,遇到了更新下载失败问题:

Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-8.xml
Done loading packages.
Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: Connection to https://dl-ssl.google.com refused
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-8.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-8.xml, reason: HttpHostConnect Connection to https://dl-ssl.google.com refused
Done loading packages.


搜索了下,解决方案如下:

解决国内访问Google服务器的困难:
1.启动 Android SDK Manager ;
2.打开主界面,依次选择「Tools」、「Options...」,弹出『Android SDK Manager - Settings』窗口;
3.在『Android SDK Manager - Settings』窗口中,在「HTTP Proxy Server」和「HTTP Proxy Port」输入框内填入mirrors.neusoft.edu.cn和80,并且选中「Force https://... sources to be fetched using http://...」复选框;4.设置完成后单击「Close」按钮关闭『Android SDK Manager - Settings』窗口返回到主界面;
5.依次选择「Packages」、「Reload」。



http://m.blog.csdn.net/blog/zhanglu0223/38765009#

http://www.maopiaopiao.com/article/37175.htm

本篇文章是对Android SDK下载和更新失败的解决方法进行了详细的分析介绍,需要的朋友参考下。最近开始搭建Android开发环境的时候,下载SDK总是会出现如下错误:






说dl-ssl.google.com在大陆被强了,解决方法就是修改C:WindowsSystem32driversetchosts文件。添加一行:

74.125.237.1       dl-ssl.google.com




这里需要注意的是hosts文件是只读的,我们没有权限修改,需要我们将hosts文件复制到桌面或者其他地方,然后修改,代码如下:

# Copyright (c) 1993-2009 Microsoft Corp.

#

# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.

#

# This file contains the mappings of IP addresses to host names. Each

# entry should be kept on an individual line. The IP address should

# be placed in the first column followed by the corresponding host name.

# The IP address and the host name should be separated by at least one

# space.

#

# Additionally, comments (such as these) may be inserted on individual

# lines or following the machine name denoted by a '#' symbol.

#

# For example:

#

#      102.54.94.97     rhino.acme.com          # source server

#       38.25.63.10     x.acme.com              # x client host  
 # localhost name resolution is handled within DNS itself.

# 127.0.0.1       localhost

# ::1             localhost

#就是增加这一句

74.125.237.1       dl-ssl.google.com

然后保存,复制修改后的hosts文件到C:WindowsSystem32driversetc 目录,替换文件就好!!!我们再次下载SDK的时候就会成功啦,如下图:



PS:补充下,在mac或Linux中,hosts文件所在位置为/etc/hosts,可以使用sudo vim /etc/hosts来编辑


其它网友的补充:
android sdk 下载后,通常需要更新sdk对应的平台的版本,但是当我们开始更新的时候,通常会提示“Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com> OR <www.google.com>”这样的错误,从而导致无法进行android sdk的更新,这里提供了一种解决sdk更新的方法,希望对大家有用;
方便他人亦是方便自己,如果觉得还行就点下赞吧,这样可以帮助其他人更快的找到解决问题的方法;有疑问的也可留言哦, 谢谢!
视频和软件的百度云地址:http://pan.baidu.com/s/1sjNQzGp
工具/原料
win7 x64
android-sdk-windows r23
方法/步骤
1、下载服务器代理工具,上面的百度云地址里有,解压后(需要解压两次),安装,具体的可以参见百度云地址里的视频。


2、启动服务器代理工具“免费代理服务器”,如下:



3、打开 android sdk manager “"D:Androidandroid-sdk-windowsSDK Manager.exe"”,会发现弹出如下的错误


4、打开 “android sdk manager->tools->Options...", 设置 服务器代理地址,服务器代理地址可以从服务器代理软件上查询得到,如下图:





5、重新打开”"D:Androidandroid-sdk-windowsSDK Manager.exe"“, 运行效果如下



6、android sdk 在更新的过程中会遇到更新失败的问题如图,重新点击安装就可以解决了




标签: android

热门推荐