Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6

Joel picture Joel · Feb 26, 2018 · Viewed 151k times · Source

When trying to run the Example CorDapp (GitHub CorDapp) via IntelliJ, I receive the following error:

Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6

How can I modify the IntelliJ settings so that all the bytecode is built with the same JVM target?

Answer

Braian Coronel picture Braian Coronel · Jul 11, 2019

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