Any ideas how I can get rid of these build warnings? I got them since Kotlin 1.5.20. Somehow reflect...
h
Any ideas how I can get rid of these build warnings? I got them since Kotlin 1.5.20. Somehow reflect is stuck at 1.4.10
Copy code
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    .gradle/caches/transforms-3/59efbb5d2fb40235871696f9259a7d8d/transformed/jetified-kotlin-stdlib-jdk8-1.5.30.jar (version 1.5)
    .gradle/caches/transforms-3/e66f57a2a74abdb19022465647f40d82/transformed/jetified-kotlin-stdlib-jdk7-1.5.30.jar (version 1.5)
    .gradle/caches/transforms-3/2d4b2907d0729a36c30c280633903ab8/transformed/jetified-kotlin-reflect-1.4.10.jar (version 1.4)
    .gradle/caches/transforms-3/ef7b524e21c54733be325fc195aa1b28/transformed/jetified-kotlin-stdlib-1.5.30.jar (version 1.5)
    .gradle/caches/transforms-3/fa4d08380a08dd9897606270ef087751/transformed/jetified-kotlin-stdlib-common-1.5.30.jar (version 1.5)
s
./gradlew dependencies (or app:dependencies if Android) to check which dependency relies on older version of reflect. use terminal outside of IDE because this will be a lot of text
h
So one of the advertisement dependency seems to bring reflect with the old version
Copy code
|    +--- com.sourcepoint.cmplibrary:cmplibrary:5.3.13
|    |    +--- org.jetbrains.kotlin:kotlin-reflect:1.4.10
another dependency brings an even older version but seems to be happy with 1.5 as well:
Copy code
+--- io.mockk:mockk-agent-jvm:1.12.0
|    +--- org.jetbrains.kotlin:kotlin-reflect:1.3.72 -> 1.5.0 (*)
s
you can do something like this to force versions https://stackoverflow.com/a/53081554
or just add reflect dependency yourself with wanted version
2
t
even better would to open an issue for the plugins that brings Kotlin runtime dependencies
h
Thanks! Warnings are gone now 🙂 For that dependency I am stuck on an older version right now, could be that newer versions already bring newer dependencies. Or shouldnt they bring that dependency for a specific version at all?
t
they should not bring such dependency at all and use Gradle provided one
e
I’ve got this error recently and at the very end there was a suggestion to declare the dependency manually and that resolved the immediate warnings
z
is it a dependency or in your buildscript? If it's the latter - it' a known gradle issue because they force old versions of kotlin