简体   繁体   中英

How To Set Android JVM Target Compability in Kotlin Multiplatform Mobile Project

As the title of this question describes, I get a warning when building the Android app of my KMM project that hints me to set my JVM version to 11 as the following terminal output shows:

> Task :shared:compileDebugKotlinAndroid
'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlinAndroid' task (current target is 11) jvm target compatibility should be set to the same Java version

But how can I do that? Setting it like you'd do it in a regular Android project doesn't seem to have an effect.

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { kotlinOptions.jvmTarget = "11" }

It is only advisory property, you could safely delete it. minSdk is enough. See LibraryBaseFlavor reference deprecation message.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM