我如何使用新的 compose 1.0.0-alpha09

how can I use the new compose 1.0.0-alpha09

在项目 build.gradle 文件中,我在构建脚本中声明了 compose 和 kotlin 版本:

ext {
        compose_version = '1.0.0-alpha07'
    }
ext.kotlin_version = '1.4.10'

在该版本下,我的应用程序可以正常编译和 运行,但是当我像这样升级 compose 版本时:

ext {
        compose_version = '1.0.0-alpha09'
    }
ext.kotlin_version = '1.4.21'

而且我的构建总是会失败并显示 Backend Internal error 所以如果有人成功迁移到alpha09可以告诉我如何迁移到它吗?

在build.gradle(项目)中你应该有这个:

ext {
    compose_version = '1.0.0-alpha09'
}

并在 build.gradle(app) 中:

composeOptions {
   kotlinCompilerExtensionVersion compose_version
   kotlinCompilerVersion '1.4.21'
}

在 Android 工作室制作:

  • 构建 > 清理项目

然后:

  • 构建 > 重建项目