admin管理员组文章数量:1391987
Execution failed for task ':photo_manager:compileReleaseKotlin'.
Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (1.8) and 'compileReleaseKotlin' (17).
My setup:
- Flutter version: 3.22.4
- Gradle version: 8.11.1
- Android Gradle Plugin (AGP): 8.9.0
- Kotlin version: 2.1.10
- JVM version: 17
- compileSdk: 35
What I’ve tried:
- Ensuring Java Compatibility: In android/build.gradle and android/app/build.gradle:
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
- Setting Kotlin JVM Target: In android/gradle.properties:
kotlinpiler.jvmTarget=17
- Adding Java Toolchain to Gradle: In android/app/build.gradle:
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
- Adding Kotlin Toolchain to Gradle:
kotlin {
jvmToolchain(17)
}
Even after these changes, the error still persists. I also tried downgrading the Kotlin target to 1.8 to match Java, but it didn’t help.
How can I resolve this JVM-target inconsistency?
本文标签:
版权声明:本文标题:Inconsistent JVM-target compatibility: compileReleaseJavaWithJavac (1.8) and compileReleaseKotlin (17) in Flutter Android Build 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744606562a2615391.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论