1、在安装新Android Studio时会下载最新版本的Gradle,在目录C:\Users\ZNCT\.gradle\wrapper\dists
项目是在 你的项目-gradle->wrapper->gradle-wrapper.properties中
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
项目->build.gradle->dependencies->
classpath 'com.android.tools.build:gradle:3.1.2'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
//最新版本build
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
repositories {
google()
}
}
allprojects {
repositories {
google()
maven { url 'https://jitpack.io'
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
2、最新Android studio 3.1.2 项目->app->build.gradle里的加入第三方包,在从之前的compile更新为
implementation或api才能build成功