KMP library: compile with lower version?

Currently I use KMP to create a multiplatform library which also targets Android. the issue is that my library project uses multiplatform version 1.9.0 which means that .class files are compiled with kotlin 1.9.0 even tho the lib itself only requires 1.5.31. when our Android guys try to use that lib, they get an error “… was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.” which means that the lib was compiled with 1.9.0 and they only have 1.7.1 supported. the problem is that they can’t bump kotlin version as it is a mess on Android: Compose, Hilt, Coroutines – they all require specific versions and 1.9.0 is not achievable right now. if I try to lower multiplatform version – basically everything breaks to the point I can’t fix it.

the question is: can I use 1.9.0 multiplatform version, but compile android/jvm library with lower kotlin version i.e. 1.5.31? thank you very much!

submitted by /u/cakee_ru
[link] [comments]