We’re adding Kotlin to our legacy code base and ha...
# android
a
We’re adding Kotlin to our legacy code base and have run into a problem running Android JUnit tests written in Kotlin in Android Studio. I believe the problem is related to the IDE thinking that the Kotlin Plugin and Kotlin Runtime are different, however both the plugin and the gradle are using Kotlin vs. 1.2.21. Android Studio thinks the runtime version is set to 1.1.4-3. I’ve grepped the code base for any references to that version and they are none. However, after assembly, Android Studio adds a library in
.idea
for that version of kotlin in addition to the 1.2.21. This version isn’t coming from an old cache. I’ve actually tested this after nuking AS and all associated prefs/caches/etc. The old version of Kotlin appears to be coming from a dependency. However, when I look at the gradle dependencies, there are no references to 1.1.4-3, only 1.2.21. One thing of note, is that we do have a small module using the new Kotlin DSL. I’m not sure if that could be causing issues? We’re not explicitly setting a version in the
build.gradle.kts
. Thank you so much for your help!