1. 问题
e: This version (1.3.2) of the Compose Compiler requires Kotlin version 1.7.20 but you appear to be using Kotlin version 1.9.0-Beta which is not known to be compatible. Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
代码如下:
(工程下的build.gradle)
plugins {
id 'com.android.application' version '8.0.1' apply false
id 'com.android.library' version '8.0.1' apply false
id 'org.jetbrains.kotlin.android' version '1.9.0-beta' apply false
}
2.处理
更改为1.7.20 即可
或者更改build.gradle(app)中的以下版本:
composeOptions {
kotlinCompilerExtensionVersion '1.3.2'
}
版本兼容关系参考链接:https://developer.android.com/jetpack/androidx/releases/compose-kotlin?hl=zh-cn

文章提到,在使用ComposeCompiler1.3.2时遇到了与Kotlin1.9.0-Beta版本不兼容的问题。解决方案是将Kotlin版本降级到1.7.20,或者在build.gradle(app)中修改composeOptions的kotlinCompilerExtensionVersion为1.3.2。用户应参考Android官方的ComposeKotlin版本兼容性指南来确保正确的配置。
2893

被折叠的 条评论
为什么被折叠?



