【安卓】AndroidStudio使用本地gradle进行build的配置


1.修改setting使用local gradle

2.将下载的gradle-6.7.1-all.zip放入E:/AndroidProject文件夹

修改gradle-wapper.propertie使用本地gradle
distributionUrl=file\:///E:/AndroidProject/gradle-6.7.1-all.zip

3.修改build.gradle使用国内阿里云镜像
'''
buildscript {
    repositories {
        maven{ url = "http://maven.aliyun.com/nexus/content/groups/public/" }
        google()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.1"
    }
}

allprojects {
    repositories {
        maven{ url = "http://maven.aliyun.com/nexus/content/groups/public/" }
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
'''

三个步骤缺一不可