https://kotlinlang.org logo
r

Robert Wijas

07/05/2021, 4:15 PM
I have a KMM project which I just updated to kotlin 1.5.20. All works fine, but Android Studio still thinks that my common module depends on 1.4.32. When I build with Gradle all seems to be correctly using version 1.5.20, I get warnings that I expect to get etc. But when I open the file with 1.5.20 warning Studio doesn’t highlight it and looks like it links edited file to 1.4.32. Any hints? TIA
j

Javier

07/05/2021, 4:23 PM
Have you using kotlin dsl with gradle?
r

Robert Wijas

07/05/2021, 4:24 PM
Yes, the module is using kotlin dsl, however the main project gradle is not.
j

Javier

07/05/2021, 4:53 PM
Are you sure it is not the Gradle internal version?
share the warnings if possible
r

Robert Wijas

07/05/2021, 7:07 PM
warnings are not that important, the main problem is that for my KMM common module android studio editor is using kotlin 1.4.32, all other modules are using the intended 1.5.20, even my KMM androidTest module
The warnings I mentioned are caused by changing kotlin version from 1.4.32 to 1.5.20, e.g.
k

kevindmoore

07/05/2021, 7:11 PM
I see the same thing and I use Kotlin DSL through the project. Probably some other library depends on it
r

Robert Wijas

07/05/2021, 7:14 PM
I analysed the gradle
app:dependencies
and yes, some libs are depending on 1.4 but gradle is resolving the dependency correctly and uses 1.5.20. Again, all is working great when I’m building with gradle, it’s just the editor that is confused and sticks to the old kotlin version.
r

Rak

07/06/2021, 7:56 AM
did you try invalidate caches and restart?
r

Robert Wijas

07/06/2021, 8:42 AM
Yep, one of the first things I tried 🙂