212 文字
1 分
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.2.51 and higher ~Kotlin Gradle pluginのバージョンが古いと怒られた話~
2018-10-08
2018-12-23

エラー#

久しぶりにAndroid Studioを起動して、促されるままに諸々バージョンアップしたら、↓↓のように怒られて作ってたアプリのbuildが失敗するようになってしまいました。

The Android Gradle plugin supports only Kotlin Gradle plugin version 1.2.51 and higher. Project 'hogehoge' is using version 1.1.51.

そのうちまた出会いそうな予感がするので、対応メモを残しておこうと思います。

対策#

これが作ってるアプリのbuild.gradleです。

buildscript {
ext.kotlin_version = '1.1.51' // ここを修正
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.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 {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

2行目のext.kotlin_version = '1.1.51'のバージョン部分を1.2.51に変更するだけです。簡単ですね。