Say my app version is using Kotlin 1.6.21, and I i...
# getting-started
n
Say my app version is using Kotlin 1.6.21, and I include two other dependencies that are using Kotlin
1.7.0
and
1.4.32
. Is there any possibility that there could be some sort of conflict since the versions are different? What about a similar situation with something like Jetpack Compose or Koin?
a
Kotlin is pretty adamant about backwards compatibility, so unless those dependencies use opt-in unstable APIs, you should be good
n
Are you suggesting that the dependency kotlin version would be upgraded?
a
Your app would end up using the highest stdlib version out of all your dependencies, which would be
1.7.0
. Normally, this won't be an issue, but it's caused me problems before. Javalin 3's annotation-based OpenApi integration only works with kotlin stdlib
1.4
and below, but some of my other libraries would upgrade the stdlib past that. I suppose so long as those libraries didn't depend on any
1.5+
features, I could have excluded the stdlib from them, but your best best would be to just use the latest version of the stdlib, if possible. The only reason it was an issue for me was that upgrading javalin would have been a pain, and I wanted to migrate to another server anyway.
❤️ 1
e
anything that relies on kotlin.Metadata, such as reflection or annotation processing or similar, may have issues
❤️ 1
but Kotlin is backward compatible and currently has 1 version of forward compatibility on metadata, so Kotlin 1.6 compiler should be able to link with Kotlin 1.0-1.7 binaries
❤️ 1
n
Thanks!