With Gradle 7 and Kotlin 1.5 I get this warning in...
# gradle
e
With Gradle 7 and Kotlin 1.5 I get this warning in a lot of my plugins and buildSrc. What's the best way to address this (adding an explicit dependency on kotlin-reflect 1.5 doesn't help):
Copy code
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /home/me/.gradle/wrapper/dists/gradle-7.0-all/9m115ut5nwvtxli7nys8pggfr/gradle-7.0/lib/kotlin-stdlib-1.4.31.jar (version 1.4)
    /home/me/.gradle/wrapper/dists/gradle-7.0-all/9m115ut5nwvtxli7nys8pggfr/gradle-7.0/lib/kotlin-stdlib-common-1.4.31.jar (version 1.4)
    /home/me/.gradle/wrapper/dists/gradle-7.0-all/9m115ut5nwvtxli7nys8pggfr/gradle-7.0/lib/kotlin-stdlib-jdk7-1.4.31.jar (version 1.4)
    /home/me/.gradle/wrapper/dists/gradle-7.0-all/9m115ut5nwvtxli7nys8pggfr/gradle-7.0/lib/kotlin-stdlib-jdk8-1.4.31.jar (version 1.4)
    /home/me/.gradle/wrapper/dists/gradle-7.0-all/9m115ut5nwvtxli7nys8pggfr/gradle-7.0/lib/kotlin-reflect-1.4.31.jar (version 1.4)
    /home/me/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.0/65fbc439df2e4aad1f3769762d54534f1b564090/kotlin-stdlib-jdk8-1.5.0.jar (version 1.5)
    /home/me/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.5.0/47806fe8ed30dbdf9e697eda5e9c9a3905ff3363/kotlin-reflect-1.5.0.jar (version 1.5)
    /home/me/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.0/f61904618ea7be07a66e0545ffe8dc2c70a19b77/kotlin-stdlib-jdk7-1.5.0.jar (version 1.5)
    /home/me/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.0/29dae2501ca094416d15af0e21470cb634780444/kotlin-stdlib-1.5.0.jar (version 1.5)
    /home/me/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.0/4080d69efca5e39e9b4972f125e40f1607bd6460/kotlin-stdlib-common-1.5.0.jar (version 1.5)
w: Consider providing an explicit dependency on kotlin-reflect 1.5 to prevent strange errors
I think https://youtrack.jetbrains.com/issue/KT-41142 relates to my question
If I understand it correctly, it's saying that I can't use Kotlin 1.5 with Gradle 7, because Gradle 7 depends on Kotlin 1.4.31, which causes a warning, and my build will fail if there is a warning (
allWarningsAsErrors = true
)
v
Yes, the issue you found is exactly your problem, so let's hope 1.5.10 improves on that. In the meantime you would need to remove fail-on-warning and ignore the warning and if everything works, you are in luck.
👍 2
s
I just came to post this same issue. Thank you @eygraber and @Vampire for the tip.
e
Same error is giving me problems to day as well updating Kotlin to 1.5