我为我的 Compose 工程升级 AGP 后 (7.0.0 > 7.0.2)重新编译发生下面错误

ComposeOptions.kotlinCompilerVersion is deprecated. Compose now uses the kotlin compiler defined in your buildscript.

以前需要通过该 composeOptions 指定 Kotlin 版本
在这里插入图片描述
升级后,直接复用 buildScript 的 Kotlin 版本, composeOptions 已经没用了,可以删掉即可

buildscript {
    ext.kotlin_version = '1.5.31'
    //....
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐