Android Studio 下载 gradle 速度慢解决方法

Android Studio 下载 gradle 速度慢解决方法

  1. 首先找到工程的build.gradle文件
  2. 注释掉 jcenter() ,修改成阿里云镜像
// 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/'}
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.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
}

你可能感兴趣的:(Android Studio 下载 gradle 速度慢解决方法)