Android开发SDK与Gradle更新解决方案

来源:互联网 发布:网易蜂巢和阿里云 编辑:程序博客网 时间:2024/05/16 08:52

    • 导读
    • Android SDK Update
      • 1 SDK Manager设置
      • 2 Host文件更改
        • Hosts文件位置
        • Hosts文件更改注意事项
        • 21 Hosts文件更改方案一
        • 22 Hosts文件更改方案二推荐
        • 23 Hosts文件更改方案三
    • AndroidStudio Gradle Update
      • 1 直接使用翻墙工具更新Nydus推荐
      • 2 更改Hosts文件

1. 导读

Android开发工具Eclipse与AndroidStudio 伴随着Android版本提升,SDK与Gradle也得同时更新,但国内几乎无法更新,购买了能更新工具Nydus,价格比较合理,在公司Windows 7使用稳定性ok,但在家里Mac系统使用经常抽疯,MacBook更新SDK与Gradle只好借助更改系统Hosts文件。

2. Android SDK Update

2.1 SDK Manager设置

  • SDK Manager,在界面上方找Tools->Options打开了SDK Manager的Settings;
  • 选中“Force https://… sources to be fetched using http://…”,强制使用http协议
    2015-10-21_105140.png-47.4kB

2.2 Host文件更改

Hosts文件位置

Windows :C:\WINDOWS\system32\drivers\etc Mac     :/etc/hostsLinux   :/etc/hostsAndroid手机:/system/etc/

Hosts文件更改注意事项

  • Mac 打开/etc/hosts方法
    打开文件管理器(Finder),按组合键“Shift+Command+G”键入 /etc/hosts
  • Hosts文件无更改权限
    Hosts文件复制到桌面更改,然后替换原Hosts文件

2.2.1 Hosts文件更改方案一

Hosts文件中增加下列文本

203.208.46.146 dl.google.com203.208.46.146 dl-ssl.google.com74.125.237.1   dl-ssl.google.com

2.2.2 Hosts文件更改方案二(推荐)

实时更新的Hosts文件

老D博客:http://laod.cn/hosts/2015-google…hosts.html
谷友部落格:http://igge.gq/2015/07/16/11/

2.2.3 Hosts文件更改方案三

Android SDK在线更新镜像服务器
中国科学院开源协会镜像站地址:

IPV4/IPV6: http://mirrors.opencas.cn 端口:80IPV4/IPV6: http://mirrors.opencas.org 端口:80IPV4/IPV6: http://mirrors.opencas.ac.cn 端口:80

上海GDG镜像服务器地址:

http://sdk.gdgshanghai.com 端口:8000

北京化工大学镜像服务器地址:

IPv4: http://ubuntu.buct.edu.cn/ 端口:80IPv4: http://ubuntu.buct.cn/ 端口:80IPv6: http://ubuntu.buct6.edu.cn/ 端口:80

大连东软信息学院镜像服务器地址:

http://mirrors.neusoft.edu.cn 端口:80

腾讯Bugly 镜像:

http://android-mirror.bugly.qq.com 端口:8080腾讯镜像使用方法:http://android-mirror.bugly.qq.com:8080/include/usage.html

3. AndroidStudio Gradle Update

3.1 直接使用翻墙工具更新Nydus(推荐)

3.2 更改Hosts文件

老D博客:http://laod.cn/hosts/2015-google…hosts.html
谷友部落格:http://igge.gq/2015/07/16/11/

0 0
原创粉丝点击