解决AS gradle下载同步卡慢的问题
国内因为GFW的原因,导致同步谷歌等服务器的插件源非常非常慢,几乎是龟爬,还好有阿里云的镜像源,据说速度很快,还不快试试:
1、build.gradle里的buildscript和allprojects添加阿里镜像
repositories {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
}
详细配置示例如下:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
2、setting里HTTP proxy里设置HTTP代理:
大连东软信息学院镜像服务器地址:
- http://mirrors.neusoft.edu.cn 端口:80
北京化工大学镜像服务器地址:
- IPv4: http://ubuntu.buct.edu.cn/ 端口:80
- IPv4: http://ubuntu.buct.cn/ 端口:80
- IPv6: http://ubuntu.buct6.edu.cn/ 端口:80
上海GDG镜像服务器地址:
- http://sdk.gdgshanghai.com 端口:8000
补充:
然后,再记录几个 Android SDK update sites:
1.mirrors.neusoft.edu.cn //东软信息学院
2.ubuntu.buct.edu.cn/ubuntu.buct.cn //北京化工大学
3.mirrors.opencas.cn (mirrors.opencas.org/mirrors.opencas.ac.cn) //中国科学院开源协会
4.sdk.gdgshanghai.com 端口:8000 //上海GDG镜像服务器
5.mirrors.dormforce.NET //(栋力无限)电子科技大学
其中,强烈推荐电子科技大学的镜像源!
多个源仓库地址如下:
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
maven { url 'http://maven.oschina.net/content/groups/public/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "http://maven.springframework.org/release" }
maven { url "http://maven.restlet.org" }
maven { url "http://mirrors.ibiblio.org/maven2" }
maven {
url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/"
}
maven { url 'https://maven.fabric.io/public' }
jcenter()
google()
}
用nexus搭建的maven私服,阿里云的,那下载速度真是杠杠的;
配置很简单,修改conf文件夹下的settings.xml文件,添加如下镜像配置:
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
解决AS gradle下载同步卡慢的问题的更多相关文章
- React Native Android gradle下载慢问题解决
很多人会遇到 初次运行 react-native run android的时候 gradle下载极慢,甚至会失败的问题 如下图 实际上这个问题好解决的 首先 把对应版本的gradle下载到本地任意一个 ...
- gradle下载地址
gradle下载:http://services.gradle.org/distributions
- 解决Myeclipse 编辑jsp页面卡
解决Myeclipse 编辑jsp页面卡 编辑一个jsp页面时,如果每输入一下,CPU都100%一下,和大家分项一下. 问题: 当你编辑一个jsp页面时,如果每输入一下,CPU都100%一下,3, ...
- 定义任务打印gradle下载的jar包位置
//定义任务打印gradle下载的jar包位置task showMyCache { configurations.compile.each { println it }}
- Swift正在使用NSURLConnection异步下载同步(实例解析)
原版的blog.转载请注明出处 http://blog.csdn.net/hello_hwc 一.同步异步两个概念 简单来讲.同步就是函数或者闭包(objective c中的block)运行完成才干返 ...
- gradle下载的依赖包位置 及 修改
gradle下载的依赖包位置 2018年08月01日 00:37:06 LuckyJiang-2019 阅读数:3569 Mac系统默认下载到: /Users/(用户名)/.gradle/cach ...
- MACACA===gradle下载和安装
gradle下载地址: http://services.gradle.org/distributions/ 或者直接点击这个: http://services.gradle.org/distribut ...
- 解决 scp 和rsync 同步失败【rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]】
解决 scp 和rsync 同步失败 报错信息截图: 解决问题的步骤: 1.检查对方的scp和rsync 是否能使用. rsync 在使用的时候,需要客户端和服务端都有rsync工具.scp 和 rs ...
- 微服务架构-Gradle下载安装配置教程
一.开发条件 JDK8下载地址:https://www.oracle.com/java/technologies/javase-jdk8-downloads.html Eclipse下载地址:http ...
随机推荐
- 【转】Python之面向对象与类
[转]Python之面向对象与类 本节内容 面向对象的概念 类的封装 类的继承 类的多态 静态方法.类方法 和 属性方法 类的特殊成员方法 继承层级关系中子类的实例对象对属性的查找顺序问题 一.面向对 ...
- 查询设备的IP地址/掩码/MAC/网关
import commands, sys import platform from _utils.patrol2 import run_cmd, data_format, report_format ...
- logging模块--日志文件
初级的使用配置模式类似与print 默认打印waring等级及以上--通过更改等级来测试代码 logging.debug("debug no china") #调试模式 loggi ...
- struts2项目搭建
把strutslib中的所有jar包添加到类路径 在src下创建struts.xml文件 <?xml version="1.0" encoding="UTF-8&q ...
- python beautifulsoup爬虫学习
BeautifulSoup(page_html, "lxml").select(),这里可以通过浏览器开发者模式选择copy selector,并且并不需要完整路径. github ...
- MySQL配置说明
以下内容,来源于http://www.jb51.net/article/48082.htm [client] port = 3306 socket = /tmp/mysql.sock [mysqld] ...
- telnet mysql时出现:is not allowed to connect to this MySQL serverConnection closed by foreign host问题的解决
有时候telnet一个mysql服务器的时候会出现: Host '192.168.0.1' is not allowed to connect to this MySQL serverConnecti ...
- 4)协程一(yeild)
一:什么协程 协程: coroutine/coro - 轻量级线程(一个线程) - 调度由用户控制 - 有独立的寄存器上下文和栈 - 切换时保存状态,回来时恢复 二:协程和多线程比较 协程: coro ...
- python时间日期格式化和反格式化
strftime()和strptime()行为 date,datetime和time对象都支持一种 strftime(format)方法,以创建一个表示显式格式字符串控制下的时间的字符串.从广义上讲, ...
- 二进制补码除法——计算机底层整数除法模拟之Java实现
前面讲到布思算法的计算机底层模拟的时候,我们是借助于一个可以储存.表示任意N位的二进制补码的BinaryQueue实现的,现在我们模拟计算机底层整数除法还是要借助于它: BinaryQueue类代码: ...