I am getting a warning as I build an Android Kotlin w/ Jetpack compose app with Android Studio like this:
Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
.../transformed/jetified-kotlin-stdlib-jdk8-1.5.31.jar (version 1.5)
.../transformed/jetified-kotlin-stdlib-jdk7-1.5.31.jar (version 1.5)
.../transformed/jetified-kotlin-stdlib-1.6.10.jar (version 1.6)
.../transformed/jetified-kotlin-stdlib-common-1.6.10.jar (version 1.6)
The Kotlin version I am using with my project is 1.5.31
, since It is compatible with Compose compile version 1.0.5
.
The Kotlin plugin version installed on Android Studio is 1.6.10
Just for reference I am using Android Studio Bumblebee | 2021.1.1 Patch 1.
Shall I downgrade the plugin Kotlin version on Android Studio from 1.6.10 to 1.5.31? Or, just ignore the warning? Other solution?
This have nothing to do with the plugin version you have installed. Probably some dependency of yours have kotlin 1.6.10 dependency and that's why you hvae this conflict. Try to find out which one using dependency tree - my recommendation is to use gradle scan
, you can read about it here. In gradle scan results you can go through all of your dependencies in a tree, like here. You have to find which library is using newer kotlin and then use older version of that library that's targeting your kotlin version