Kotlin compile "ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher." but no kotlin_version in build.gradle?
Define your ext.kotlin_version
Your project level build.gradle should look like this.
buildscript {
ext.kotlin_version = '1.2.51'
ext.android_plugin_version = '3.2.1'
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:$android_plugin_version"
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
}
}
Change
org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version
instead of
org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version
I faced this problem too and I fixed it by doing the following:
- In project level build.gradle, I have ext.kotlin_version = '1.3.10'
buildscript {
ext.kotlin_version = '1.3.10'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
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()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
roomVersion = '1.0.0'
archLifecycleVersion = '1.1.0'
}
- Then in app level build.gradle, I updated my dependencies to have this:
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
I built, and everything worked fine again.