英文:
New compose version 1.4.3 gives a weird error
问题
好的,以下是翻译好的部分:
"Okey so when i start a new project with sdk 33 in android studio everything is fine. I go into the gradle of the app and see that the versiuon of compose are not the newest version. If i update them to the newest version though i get an error that says
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
I have no clue why but is the new version of compose to unstable or do i have the wrong jdk i have no clue it just gives me this error trying to switch any version of anything either gives me the same error or a new one... Anyone knows why this happens"
英文:
Okey so when i start a new project with sdk 33 in android studio everything is fine. I go into the gradle of the app and see that the versiuon of compose are not the newest version. If i update them to the newest version though i get an error that says
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
I have no clue why but is the new version of compose to unstable or do i have the wrong jdk i have no clue it just gives me this error trying to switch any version of anything either gives me the same error or a new one... Anyone knows why this happens
答案1
得分: 2
如果您使用的是Compose版本1.4.3,您应该使用最新的Kotlin版本1.8.21和Compose编译器版本1.4.7。请参考此文档以查看Compose版本的兼容性。
在您的项目build.gradle文件中:
plugins {
id("org.jetbrains.kotlin.android") version "1.8.21" apply false
}
在您的应用程序build.gradle文件中:
android {
composeOptions {
kotlinCompilerExtensionVersion = "1.4.7"
}
}
您可能还需要升级您的Android Gradle插件和Java版本。
英文:
If you are using compose version 1.4.3, you should use the latest Kotlin version 1.8.21 and compose compiler version 1.4.7. Please refer to this documentation for compose version compatibility.
In your project build.gradle file:
plugins {
id("org.jetbrains.kotlin.android") version "1.8.21" apply false
}
In your app build.gradle file:
android {
composeOptions {
kotlinCompilerExtensionVersion = "1.4.7"
}
}
You may need to upgrade your Android Grade Plugin and Java version too.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论