Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6
app/build.gradle
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
GL
Use Java 8 language features
You can fix this issue as follows:
- Open the IntelliJ preferences
- Go to
Build, Execution, Deployment
>Compiler
>Kotlin Compiler
BUTOther Settings
>Kotlin compiler
if Android Studio >3.4
- Change the
Target JVM version
to1.8
- Click
Apply
you should configure something like as follows in build.gradle
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}