在我的多模块Android项目中,我面临着Kotlin版本冲突的问题.在try 构建时,我收到以下错误:
.gradle/caches/transforms-3/d03e801dea1b3ff22428c51c576b323b/transformed/jetified-agent-android-8.283.1.1004-api.jar!/META-INF/agent.instrumentorAPI.compose_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
个
我的项目由几个模块(profile
、survey
、app
)组成,每个模块都有自己的build.gradle
文件.在项目级build.gradle
中,我将Kotlin版本设置为1.6.0:
buildscript {
ext.kotlin_version = '1.6.0'
}```
However, I am facing an issue where the module seems to require Kotlin 1.9.0. Here are some key details of my setup:
Android Studio version: [Android Studio Giraffe | 2022.3.1 Patch 3]
Kotlin version: 1.6.0 (as specified in the project's build.gradle)
Gradle version: [7.0.4]
I tried fixing a Kotlin version conflict in my project by clearing the Gradle cache, both via Android Studio and manually in the .gradle folder, restarting Android Studio, and aligning Kotlin versions across all modules. Despite these efforts, the error 'Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0' still appears, suggesting unresolved issues in project configuration or dependencies.
Could anyone advise on resolving this conflict without upgrading to Kotlin 1.9.0, despite having Kotlin 1.6.0 set in the project-level build.gradle?
Thanks in advance for any insights or suggestions!
Best regards.