Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve symbol kotlinOptions (in Gradle build)

I'm trying to get the Kotlin compiler to generate Java 1.8 bytecode instead of 1.6 bytecode. Both the official docs and this StackOverflow question say you need to use code like this:

compileKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

However, when I add this to my Gradle configuration, IntelliJ tells me that the symbol kotlinOptions cannot be resolved. Why is this? I'm using Kotlin v1.2.0, and it can compile code just fine, but it can't set this option.

like image 433
Matt Y Avatar asked Nov 30 '17 08:11

Matt Y


1 Answers

As @Mikezx6r explained, the option is there otherwise it wouldn't compile. It's just that IntelliJ does not see this. Note that the 'Cannot resolve symbol' inspection does not generate any error, warning or even typo, it only greys out the option.

like image 113
PHPirate Avatar answered Nov 20 '22 05:11

PHPirate