1
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?

yardımcı Etis
  • 140
  • 2
  • 12

1 Answers1

0

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)
  }
 }
KP_
  • 1,854
  • 25
  • 43