新的Compose版本1.4.3出现了一个奇怪的错误。

huangapple go评论95阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年6月5日 17:59:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/76405294.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定