When can we expect support for Kotlin 2.1 on kotli...
# kotlinx-datetime
p
When can we expect support for Kotlin 2.1 on kotlinx datetime? Not having this holds us back form upgrading all our multiplatfrom projects to Kotlin 2.x. So this is very much needed and will be highly appreciated! Any timeline in sight? @Dmitry Khalanskiy [JB]
solved 1
d
Hi! Could you clarify what special support for 2.1 is missing from kotlinx-datetime?
p
When we bundle the current version in a library that targets kotlin 2.1 then we cannot use it with a kotlin 2.1 project. This project then has a dependency to kotlin 1.9.x and 2.1 and therefore the standard libraries are not picked up correctly and nothing compiles.
... and on top of that everything in our library is just not available to the project
Do you know what I mean?
d
Sorry, no, I don't understand the problem. There shouldn't be two versions of the stdlib, as the 2.1 stdlib should take priority, and kotlinx-datetime should work with the 2.1 stdlib. Could you possibly share the project where the problem occurs?
p
Not at the moment
Ok so what happens is:
Currently our library targets 1.9.25 and the project does as well -> all is good
When we set the target of the lib to 2.1.10 and the project as well, then our entire lib is simply not available. It is a multiplatform project.
Gradle will import the library but none of the classes are available in the IDE and the compiler also complains that there is nothing there.
d
I've just tried creating a Kotlin project with the 2.1.10 version of the compiler that uses
kotlinx-datetime
0.6.2, and the line
Clock.System.now().toLocalDateTime(TimeZone.of("Europe/Berlin"))
compiles and runs without issues. There are also no errors in the IDE.
p
Sure, but we have a nother step inbetween
We have a 2.1.10 library that uses 0.6.2 ...
the lib works perfectly fine
But we cannot use this lib in a 2.1.10 project
...
Or maybe it is something completely different. Has something changed on how multiplatform libraries need to be published to maven central?
d
Not to my knowledge, no.
p
Ok ... I will dig a bit. I guess there might be something wrong with our setup somewhere
thx!
d
The configuration you're describing also works for me when I try to reproduce the issue: a 2.1.10 project successfully uses the API from a 2.1.10 library dependent on the 0.6.2
kotlinx-datetime
.
p
Yes... I am sorry for the fuzz.
We just saw that we have a silly mistake here in how we resolve libraries.
Thank you very much. I can confirm that it works now!
🙂 1