Enable Java 8 compatibility for Kotlin sources
Enabling Java 8 compatibility via the
compileOptions block only works for Java sources. To do the same for Kotlin you need to use
kotlinOptions on any KotlinCompile Gradle tasks. Interesting…
jvmTarget = JavaVersion.VERSION_1_8
I hope the article was useful. If you have any feedback or questions please feel free to reach out to me on Twitter.
Thanks for reading and happy coding!
Hi, I hope you enjoyed the article. I am Andrew - a builder of apps and developer tools. Articles on the blog focus on all aspects of Android and iOS development using Kotlin and Swift.
Subscribe via RSS
Want to read more?
Here are some other articles you may enjoy.
The power of lazy properties in Kotlin
Kotlin makes creating properties that are initialized on first access very simple. We will go through different options for creating them and how they can be really useful in our Kotlin code.