covering_lotlin.png

今天開發Kotlin時遇到下述錯誤:

w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:

有幾個解法,不確定原因的話就全部都執行一遍:

第一、確認引用的 kotlin-srdlib-jdk7 與 kotlin-gradle-plugin 是使用相同版本

這兩個引用的地方分別可以在build.gradle(Module:app) 與build.gradle(Project:xxx)中找到

第二、看是否直接在 build.gradle(Module:app)中implement下述 dependency:

implementation "org.jetbrains.kotlin:kotlin-reflect:版本"

 

第三、我是用這個方法,就是build.gradle(Module:app) dependency 裡面的版本太新,我是直接降版,從1.6.0 ->1.0.2

implementation 'androidx.core:core-ktx:1.0.2'

 

Reference:

https://stackoverflow.com/questions/42569445/warning-kotlin-runtime-jar-files-in-the-classpath-should-have-the-same-version

 

arrow
arrow
    全站熱搜

    葛瑞斯肯 發表在 痞客邦 留言(0) 人氣()