背景介绍: Gradle 5.4.1!
Here are the highlights of this release:
Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant™ version 1.9.13 compiled on July 10 2018
JVM: 13 (Oracle Corporation 13+33)
OS: Windows 10 10.0 amd64
开发工具:AS 3.5.2
编写的代码如下:
build.gradle.kts
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
val kotlin_version="'1.3.71"
val gradle_version="3.6.2"
repositories {
google()
jcenter()
}
dependencies {
classpath ("com.android.tools.build:$gradle_version")
classpath ("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}
allprojects {
repositories {
google()
jcenter()
}
}
tasks{
val clean by registering(Delete::class){
delete(buildDir)
}
}
sync之后提示
Could not find com.android.tools.build:3.6.2:.
Required by:
project :
Search in build.gradle files