2
0

More than 3 years have passed since last update.

IntelliJ Kotlinビルド出来なくなった時の対処方法

Posted at

発生したエラー

資産を全くいじっていないプロジェクトを実行しようとしたら
ビルドでエラーになってしまった。

Caught an exception trying to connect to Kotlin Daemon:
java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.common.messages.MessageCollector$DefaultImpls.report$default(org.jetbrains.kotlin.cli.common.messages.MessageCollector, org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity, java.lang.String, org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation, int, java.lang.Object)'
(中略)

Could not perform incremental compilation: Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.


エラーを見るとKotlinのファイルが見当たらないっていっているような気がする。
そういえばKotlinのプラグインアップデートが来ていたから、何も考えずにアップデートしてしまったな…。

対応方法

適用されているkotlinのバージョンを確認。

設定>プラグインから確認。どうやら現在適用されているのは、1.4.3バージョン。

image.png

build.gradleを確認

build.gradleのkotlinバージョンは1.3.72。どうやらここが怪しそうです。

build.gradle
buildscript {
    ext {
        kotlinVersion = '1.3.72'
        springBootVersion = '2.3.1.RELEASE'
    }

build.gradleを修正

とりあえず戻せるように修正しました。

build.gradle
buildscript {
    ext {
        //kotlinVersion = '1.3.72'
        kotlinVersion = '1.4.3'
        springBootVersion = '2.3.1.RELEASE'
    }

結果

無事にビルドランできるようになりました~!!よかった~。
プラグインは無暗に更新してはいけないんでした。うっかりです。
さっきまで動いていたのに動かなくなってしまった!という事があったら
一度プラグインのバージョン確認した方が良いかもです。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0