Why kotlin gradle plugin cannot build with 1.8 target?

前端 未结 10 2143
悲哀的现实
悲哀的现实 2020-12-08 12:50

I have the simplest gradle project configured using intellij for kotlin 1.2.10. Here is my build.gradle file:

buildscript {
    ext.kotlin_version = \'1.2.10         


        
10条回答
  •  心在旅途
    2020-12-08 13:21

    //Just add the below code in your Build gradle(Module:app)

    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }
    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
        kotlinOptions {
            jvmTarget = "1.8"
        }
     }
    

提交回复
热议问题