解决 gradle 下载各种库,因为有墙的存在而下载不下来的问题,一般都可以解决,采用 阿里云 maven 仓库,配置如下。
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
// google()
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven{ url 'https://maven.aliyun.com/repository/public'}
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
//根据自己的版本走,最大设置为 studio 的版本号
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// google()
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven{ url 'https://maven.aliyun.com/repository/public'}
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
转载地址https://blog.youkuaiyun.com/pigdreams/article/details/52626794
博客主要解决了 Gradle 下载各种库时因网络限制无法下载的问题,采用阿里云 maven 仓库可解决该问题,还给出了转载地址。
1946

被折叠的 条评论
为什么被折叠?



