Since Kotlin 1.4 no longer requires stating the st...
# announcements
s
Since Kotlin 1.4 no longer requires stating the stdlib-dependency in my gradle.kts-file, I removed it, but somehow gradle now imports the 1.3 version of kotlin-reflect (I don't even need kotlin-reflect).
Copy code
> Task :module-ui:compileTestKotlin
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /home/stephan/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.4.10/998caa30623f73223194a8b657abd2baec4880ea/kotlin-stdlib-jdk8-1.4.10.jar (version 1.4)
    /home/stephan/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.4.10/30e46450b0bb3dbf43898d2f461be4a942784780/kotlin-stdlib-jdk7-1.4.10.jar (version 1.4)
    /home/stephan/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.0/6fd129fd9ba8581f2cb9c58bfd431dda4ee0457e/kotlin-reflect-1.3.0.jar (version 1.3)
    /home/stephan/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.10/ea29e063d2bbe695be13e9d044dcfb0c7add398e/kotlin-stdlib-1.4.10.jar (version 1.4)
    /home/stephan/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.10/6229be3465805c99db1142ad75e6c6ddeac0b04c/kotlin-stdlib-common-1.4.10.jar (version 1.4)
w: Consider providing an explicit dependency on kotlin-reflect 1.4 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
a
Probably a transitive dependency
Check the
dependencies
task
s
kotlin-reflect comes in as transitive dependency to kotlin-compiler-embeddable
Copy code
kotlinCompilerClasspath
\--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10
     +--- ...
     +--- org.jetbrains.kotlin:kotlin-reflect:1.4.10
     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
     +--- ...

kotlinKlibCommonizerClasspath
\--- org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.4.10
     +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10
     |    +--- ...
     \--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10
          +--- ...
          +--- org.jetbrains.kotlin:kotlin-reflect:1.4.10
          |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
          +--- ...
strangely enough, that dependency is to (the correct) version 1.4.10 of
kotlin-reflect
. Does "gradlew clean build" have another log-level then "gradlew build"? The "Runtime JAR files in the classpath should have the same version." only shows up on "gradlew clean build".
r
Maybe the message is from Gradle itself (kotlin DSL compiler?)
I see the same warning for almost all my projects since migration to 1.4.x
But no other problems
s
I’m currently using latest gradle (6.6.1).