配置Kotlin
buildscript {
ext.kotlin_version = '1.5.0'
repositories {
maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
// jcenter() // Warning: this repository is going to shut down soon
maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
}
app build.Gradle
引用最新包
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
网络不好,所以我把jcenter()换成了阿里云的包
这样就能吧kotlin引入到工程