解决AndroidStudio中gradle添加依赖包很慢的问题
在做项目的过程中我们会发现添加的远程jar需要很长时间才能下载下来,这样我们可以改变里面的build.gradle文件.
原始文件:
png整个替换成阿里的镜像库:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url'https://maven.aliyun.com/repository/public/' }
maven { url'https://maven.aliyun.com/repository/google/' }
maven { url'https://maven.aliyun.com/repository/jcenter/' }
maven { url'https://maven.aliyun.com/repository/central/' }
}
dependencies {
classpath'com.android.tools.build:gradle:3.1.0'
}
}
allprojects {
repositories {
maven { url"https://raw.githubusercontent.com/HyphenateInc/Hyphenate-SDK-Android/master/repository" }
maven { url'https://maven.aliyun.com/repository/public/' }
maven { url'https://maven.aliyun.com/repository/google/' }
maven { url'https://maven.aliyun.com/repository/jcenter/' }
maven { url'https://maven.aliyun.com/repository/central/' }
}
}
over !