Has anyone encountered that error regarding `jvmTa...
# announcements
l
Has anyone encountered that error regarding
jvmTarget
?
Copy code
> Task :some-android-lib-module:compileDebugKotlin FAILED
e: Unknown JVM target version: 1.7
Supported versions: 1.6, 1.8
m
Kotlin only distinguishes between these two, so you cannot set
1.7
.
👍 1
l
That's what I saw, and it's putting me into a dead end as I'm using a library (androidx core ktx) that has previously been compiled with 1.7 while it was allowed, and the compiler requires me to target 1.7 (which doesn't work), or 1.8 (which is risky on Android)
m
This is just about the kind of bytecode which Kotlin generates, so
1.6
should be fine when targeting Java 7. All Java-specific properties like
source-
and
targetCompatibility
can still be 1.7.
l
Unfortunately, no. I reported the issue: https://issuetracker.google.com/issues/126434413
m
How did you set that up? This works just fine:
Copy code
dependencies {
    // …
    testImplementation 'androidx.test:core-ktx:1.1.0'
}
and
Copy code
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
    sourceCompatibility = JavaVersion.VERSION_1_7
    targetCompatibility = JavaVersion.VERSION_1_7

    kotlinOptions {
        jvmTarget = '1.6'
    }
}
oh nvm, now I see it
only breaks for inline functions 😕
l
Yep, like
launchActivity