I have to update version of kotlin in my project, ...
# android
k
I have to update version of kotlin in my project, but now how i should select which version i can use in android ? i mean can i use any latest stable version of kotlin ? or i have to use any specific selected version ? Current kotlin version i'm using =
kotlin = "1.8.22"
e
In theory you can use any version, but some of your dependencies might have conflicts (for example ksp). And after updating you might have some deprecations or errors.
k
Yes, it is becoming very frustrating to upgrade versions of koltin and compose altogether
m
Every library used in your project comes with documentation. You can refer to it to see which version of Kotlin is compatible with it.
s
@Kulwinder Singh the concern around Compose with Kotlin has been fixed for a while now, since the release of Kotlin 2.0. Now the Compose Compiler is part of the Kotlin repo itself, so it gets updated hand in hand with it, you can do
kotlin("compose")
in your buildscript passing in the same kotlin version you're using, and it'll Just Work™
Also, since you're coming all the way back from Kotlin 1.8, I'd recommend you move up in steps. Start with 1.9, then each of its subversions, as these were preparing most projects for compatibility with K2. After that you can move to 2.0 (maybe you can even jump straight to 2.1 without issues). If you use Kapt/Ksp and some other libs you'll have some work to do, but it shouldn't be too difficult.