Kotlin is now version 1.9
When I created a new project in Android Studio (Giraffe), it was still targeting Kotlin 1.8.
I change the build.gradle
below to 1.9
kotlinOptions {
jvmTarget = "1.9"
}
But it error out stating Unknown Kotlin JVM target: 1.9
I check https://blog.jetbrains.com/kotlin/2023/07/kotlin-1-9-0-released/, and it mentions
For Android Studio Giraffe (223) and Hedgehog (231), the Kotlin 1.9.0
plugin will be included in upcoming Android Studios updates.
How would I know if I got the plugin already? How to install it if I don’t have the plugin yet?
3
Answers
Looks like I can set it in the project's
build.gradle.kts
, i.e. setting it to1.9.10
In Android Studio:
Settings
->Languages & Frameworks
->Kotlin
And you can check your Kotlin version from there.
EDIT:
(See this also)
I think the problem comes from the typo in a documentation somewhere.
Like here:
Just use
jvmTarget = "19"
instead. As the documentation says this option meaning is "Target version of the generated JVM bytecode". So "1.9" is impossible as Java 1.9 doesn’t exist.