代码之家  ›  专栏  ›  技术社区  ›  Mahdi-Malv

在更新到1.3.0-alpha02时,找不到androidx.compose.compiler:编译器:1.3.0-alphaO2

  •  0
  • Mahdi-Malv  · 技术社区  · 2 年前

    我想测试最新版本的jetpack compose 1.3.0-alpha02( Changelog ). 因此,我创建了一个新项目,并将版本更新为 1.3.0-alpha02

    但在运行它时,我得到了一个错误,就像找不到什么一样:

    Execution failed for task ':app:compileDebugKotlin'.
    > Could not resolve all files for configuration ':app:kotlin-extension'.
       > Could not find androidx.compose.compiler:compiler:1.3.0-alpha02.
         Searched in the following locations:
           - https://dl.google.com/dl/android/maven2/androidx/compose/compiler/compiler/1.3.0-alpha02/compiler-1.3.0-alpha02.pom
           - https://repo.maven.apache.org/maven2/androidx/compose/compiler/compiler/1.3.0-alpha02/compiler-1.3.0-alpha02.pom
         Required by:
             project :app
    

    原因是什么?我没做什么特别的事。刚刚更新了版本

    1 回复  |  直到 2 年前
        1
  •  5
  •   Mahdi-Malv    2 年前

    有些东西你错过了看

    虽然当你创建一个 模板组合项目 使用安卓工作室, 它假设两者都 compose libs compose-compiler 版本相同 ,但为了 1.3.0-alpha01 不一样

    Release note : release note screenshot

    你应该看看 编写编译器 版本是 1.3.0-rc02

    所以去更新它:

    // app/build.gradle
    composeOptions {
        // kotlinCompilerExtensionVersion compose_version // Change this
        kotlinCompilerExtensionVersion "1.3.0-rc02" // to this
    }
    

    然后重试同步

    TL;博士

    一般来说,版本 编写库 可能与 编写编译器 ,因此在添加它们时,请确保添加正确的版本。