Skip to content

Kotlin JVM target issue #44

@amake

Description

@amake

I just upgraded my app to Android Gradle Plugin 8 and I get the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':file_picker_writable:compileDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

There is probably a way I can set this for all subprojects in my own app, but it also seems you should have this in your build.gradle:

android {
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions