Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compileDebugJavaWithJava' task (current target is 11) and compileDebugKotlin task (current target is 17) jvm target compatibility should be same Java

I just updated my react-native project to 0.72 and i am facing issue with my TurboModule. I did add

compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }

   kotlinOptions {
        jvmTarget = '17'
    }

in my project's build.gradle as well as in turbomodule's build.gradle file.

I also changed build.gradle.kts

java {
  sourceCompatibility = JavaVersion.VERSION_17
  targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType<KotlinCompile> {
  kotlinOptions {
    jvmTarget = JavaVersion.VERSION_17.majorVersion
    apiVersion = "1.5"
    languageVersion = "1.5"
  }
}

Updated the same in android studio as well

enter image description here

Entire source code here

like image 938
Pritish Avatar asked Jun 14 '26 04:06

Pritish


1 Answers

change java version from 17 to 11 it will work change in your app.gradle java version like this

compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = '11'
    }

and download Javajdk 11 version like this like this picture

like image 194
Yodgorbek Komilov Avatar answered Jun 16 '26 17:06

Yodgorbek Komilov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!