尝试通过IntelliJ运行示例CorDapp(GitHub CorDapp)时,出现以下错误:

如何修改IntelliJ设置,以使所有字节码都使用相同的JVM目标构建?

最佳答案

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

10-07 16:57