【问题标题】:Incompatible Compose runtime versionCompose 运行时版本不兼容
【发布时间】:2021-10-11 21:51:06
【问题描述】:

我正在尝试在多模块项目中实现撰写,但我不断收到以下错误:

androidx.compose.compiler.plugins.kotlin.IncompatibleComposeRuntimeVersionException: You are using an outdated version of Compose Runtime that is not compatible with the version of the Compose Compiler plugin you have installed. The compose compiler plugin you are using (version 1.0.3) expects a minimum runtime version of 1.0.0.  at androidx.compose.compiler.plugins.kotlin.VersionChecker.outdatedRuntimeWithUnknownVersionNumber(VersionChecker.kt:119)

我只有为所有 Compose 依赖项指定的版本(1.0.3),我还尝试将 compose 编译器添加到 root build.gradle:

dependencies {
      implementation "androidx.compose.compiler:compiler:1.0.3"
}

在根文件我还添加了 compose 的配置:

 buildFeatures {
       compose true
 }
 composeOptions {
        kotlinCompilerExtensionVersion '1.0.3'
 }
 kotlinOptions {
        jvmTarget = '1.8'
 }

然后在模块 build.gradle 中我添加了 compose 依赖项(compose ui、material、ui toolign preview 和 uitooling),我还将 gradle 升级到最新的 7.0.2 并且仍然弹出相同的错误,我检查了 gradle 依赖关系树没有登录任何地方的 1.0.0 编译器,知道我还能尝试什么或者我做错了什么吗?

【问题讨论】:

  • 您是否直接依赖于撰写运行时?还是从其他库传递过来的?

标签: android android-jetpack-compose


【解决方案1】:

好的,所以问题是我必须在根 gradle 上包含 activity-compose 依赖项,并且它可以正常工作(如果我尝试在每个模块中包含它,它就不起作用)

【讨论】:

    猜你喜欢
    • 2018-07-29
    • 2022-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-30
    • 2016-10-12
    • 1970-01-01
    相关资源
    最近更新 更多