Reputation: 1109
I am stuck with this error
Caused by: org.gradle.api.InvalidUserCodeException: Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'kaptGenerateStubsDebugKotlin' (17).
I have tried several approach from here and here like updating my build gradle here to VERSION_17 and VERSION_21 but the error still persist
compileOptions {
// I have tried VERSION_17 and VERSION_21
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
Anyone got a clue how to solve this, app/build.gradle
build.gradle
plugins {
id("com.android.application") version "8.2.1" apply false
id("com.google.devtools.ksp") version "1.9.21-1.0.15" apply false
id("org.jetbrains.kotlin.android") version "1.9.21" apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle.wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Upvotes: 2
Views: 522
Reputation: 472
You should set your project JDK version as 17.
You can find the settings inside And. Studio Settings under Build,Execution,Deployment / Gradle / Gradle Projects
Upvotes: 0
Reputation: 1109
I fixed this with this steps
Upvotes: 0