I also faced the same issue recently and I fixed it by changing the kotlin jvm version to 2.1.0 in build.gradle.kts
Inconsistent JVM-target compatibility detected for tasks 'compileJava' (23) and 'compileKotlin' (20)
2 Likes