I have a Kotlin project in Android Studio. I am calling a static method in Java interface from the Kotlin code. The build fails with the error,
Calls to static m
The compileOptions
section in build.gradle affects the Java compiler, not the Kotlin compiler. To set the target JVM version for the Kotlin compiler, use the following block:
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
See the documentation for more information.