https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
y

ynsok

02/01/2022, 12:15 PM
Hi 😄 I have a multiplatform project targeting Desktop and Android. I would like to use the library for navigation voyager, but unfortunately, I’m getting this error.
Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
Any suggestion how to solve it ?
b

Big Chungus

02/01/2022, 12:15 PM
Bump your jvm to 11 as the error states.
This happens, because library author compiled it against JDK11, but looks like you're using JDK8
1
d

darkmoon_uk

02/11/2022, 2:22 AM
🤔 I've just started getting this on my project as well, but I'm specifying Java 11 for all
KotlinCompile
and all Android configuration blocks.
@ynsok Did you get your issue resolved?
...just fixed mine; I was missing the multiplatform form of Kotlin-level
jvmTarget
setting in one of my
android
plugin configuration blocks e.g:
Copy code
android {
    ...
    compilations.all {
        kotlinOptions {
            jvmTarget = "11"
        }
    }
}
1
y

ynsok

02/11/2022, 8:25 AM
in KMP project I need add this in shared module:
Copy code
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
    kotlinOptions {
        jvmTarget = "11"
    }
}
👍 1
3 Views