android studio插件下载慢解决方法
在配置文件build.gradle(project:xxx)中将代码修改为/ Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {repositories {// 以下四行添加阿里云的仓库地址,方便国内开发者下载相关插件maven {
·
在配置文件build.gradle(project:xxx)中将代码修改为
/ 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/jcenter' }
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'}
google()
jcenter()
}
dependencies {
// 配置gradle插件版本,下面的版本号就是Android Studio的版本号
classpath 'com.android.tools.build:gradle:4.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// 以下四行添加阿里云的仓库地址,方便国内开发者下载相关插件
maven { url 'https://maven.aliyun.com/repository/jcenter' }
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'}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
更多推荐
所有评论(0)