スポンサーリンク

Runtime JAR files in the classpath should have the same version

スポンサーリンク

現象

kotlinのバージョンを1.5.xと1.6.xで入れ替えると以下のwarningがgradle build時に発生するようになりました.原因としては,cache内に1.5.x, 1.6.xでincompatibleなモジュールが存在していたためです.おそらくKotlinを1.5.xから1.6.xに挙げた際に,1.5.xと1.6.x間でincompatibleなモジュールがダウンロードされ,cache内に残存してるんですね.

w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    C:/Users/hoge/.gradle/caches/transforms-3/c92c0b525178399d9c0b99182b753593/transformed/jetified-kotlin-stdlib-jdk8-1.5.31.jar (version 1.5)
    C:/Users/hoge/.gradle/caches/transforms-3/4cfc5b1fb0b50063bfa24ceb08bc8b27/transformed/jetified-kotlin-stdlib-jdk7-1.5.31.jar (version 1.5)
    C:/Users/hoge/.gradle/caches/transforms-3/15ea8b38e2c7d3c9223cd7deefe607b0/transformed/jetified-kotlin-stdlib-1.6.10.jar (version 1.6)
    C:/Users/hoge/.gradle/caches/transforms-3/c0b9088616440b45fadd20cd7eed01fd/transformed/jetified-kotlin-stdlib-common-1.6.10.jar (version 1.6)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath

対策

指定された.gradle/caches内のフォルダを消去して,再度Gradle Sync, Buildを実施すると発生しなくなります.

Windowsの場合は以下のコマンド消去できます.

rmdir /s /q C:/Users/hoge/.gradle/caches/transforms-3
タイトルとURLをコピーしました