yardımcı Etis
yardımcı Etis

Reputation: 100

compileDebugJavaWithJavac' task (current target is 18) and 'kaptGenerateStubsDebugKotlin' task (current target is 19)

compileDebugJavaWithJavac' task (current target is 18) and 'kaptGenerateStubsDebugKotlin' task (current target is 19) jvm target compatibility should be set to the same Java version.

Doesn't Java have backward compatibility? because of a library I had to use java 18 in a project but I updated my jdk to 19 while ago. I shouldn't get this error, should I?

Upvotes: 1

Views: 322

Answers (1)

KP_
KP_

Reputation: 1866

In case, if you get the error again, You can add the below lines inside build.gradle.kts(App level)

 android {
        ----
 compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = "1.8"
}
 kotlin {
    jvmToolchain(8)
  }
 }

Upvotes: 0

Related Questions