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… πŸ€”

For Kotlin

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {  
    kotlinOptions {  
        jvmTarget = JavaVersion.VERSION_1_8  

For Java

android {
  compileOptions {  
    sourceCompatibility JavaVersion.VERSION_1_8  
    targetCompatibility JavaVersion.VERSION_1_8  

Thanks for reading and happy coding! πŸ™