I have a KMP library(for iOS and Android) that is ...
# ktor
b
I have a KMP library(for iOS and Android) that is heavily depending on Ktor. Currently everything works fine if my library is using the same version of Ktor that is being used in the project that consumes my library. But as soon as I have different Ktor versions I get crash errors on Android and on iOS like this: Android:
Failed resolution of: Lio/ktor/client/plugins/HttpTimeout
iOS:
Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: Can not get instance of singleton 'Plugin': No class found for symbol 'io.ktor.client.plugins/HttpTimeout.Plugin|null[0]'
Is it possible to enable more flexibility with the library to not demand to have the same Ktor versions on consumer projects?
a
Can you share both version numbers?
b
This is my first library and I am not sure what can and can not be done. My library is already published on mavenCentral and it will be included as any other library to the project. is that what you are asking me? If you are asking which versions do I use in my test, I am using 2.3.6 in my library and 3.0.0-beta-2 in my sample test project.
h
You have different MAJOR versions, some of the things in 2.X aren't compatible with 3.X
☝️ 1
🙌 1
b
Is there a way to make a minimum support of my library to 2.X and support somehow everything up from there? Or should I cut my loses and just say that library works only from for projects that are using 3.X version of Ktor? How is this usually handled? Or should I create 2 artifacts, 1 for 2.X family and one for 3.X family? 😅
p
I would go with the 2 artifacts. Or just the 3.x with a migration path
🙌 1
b
Thank you guys. Will create 2 different artefacts for Ktor 2 and Ktor 3 versions.