b

    bod

    1 year ago
    Unrelated: I cannot seem to manage to use
    android { kotlinOptions {
    in kts (it works in regular gradle). And I need this to set
    jvmTarget
    to 1.8. It says
    Unresolved reference kotlinOptions
    . I verified that this syntax does work on non multiplatform android build files, with kts.
    Arkadii Ivanov

    Arkadii Ivanov

    1 year ago
    Yeah, had the same issue. This worked for me: tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { kotlinOptions.jvmTarget = "1.8" } }
    b

    bod

    1 year ago
    Thank you so much 🙏 That worked!
    travis

    travis

    1 year ago
    Kurt Renzo Acosta

    Kurt Renzo Acosta

    1 year ago
    There’s also a gradle property
    kotlin.setJvmTargetFromAndroidCompileOptions=true
    And if you set this to true in and use this in your
    android
    block:
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    No need for
    kotlinOptions.jvmTarget = "1.8"
    . Not sure if it’s the best but putting out options for everyone