gpt4 book ai didi

android - 迁移对 Android X : Are versions consistent across Modules? 的支持

转载 作者:行者123 更新时间:2023-11-29 18:31:33 24 4
gpt4 key购买 nike

我正在将一个大项目迁移到 AndroidX。

在我以前的项目中,在 build.gradle 的顶部,我定义了一个带有支持库版本的变量,因此 30 多个子 build.gradle 包含所需的支持版本:

ext {
supportLibraryVersion = "28.0.0"
buildToolsVersion = "28.0.3"
googleServicesVersion = "15.0.0"
}

我的问题是,现在我已经运行了 Android X 重构,我看到依赖项已经转换为 Android X 命名空间下的不同包甚至在它之外:

    implementation "androidx.appcompat:appcompat:1.0.0'
implementation "androidx.percentlayout:percentlayout:1.0.0"
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.google.android.material:material:1.0.0'

我的问题是,如果现在使用 Android X,所有模块版本都是同步的,那么在 top gradle 中做是有意义的:

ext {
androidXLibraryVersion = "x.x.x"
}

我的猜测是 Android X 命名空间之外的模块会有自己的版本时间表,但我什至不确定 AndroidX 命名空间下的模块是否会使用通用版本。

你怎么看?

最佳答案

在 AndroidX 世界中,每个组(即第一个 : 之前的部分,例如 androidx.appcompat)都可以根据 AndroidX Overview 有一个单独的版本:

Unlike the Support Library, AndroidX packages are separately maintained and updated. The androidx packages use strict Semantic Versioning starting with version 1.0.0. You can update AndroidX libraries in your project independently.

AndroidX releases page 上看到,它们绝对会以不同的速率升级,但语义版本控制要求可确保库的稳定版本将继续协同工作。

关于android - 迁移对 Android X : Are versions consistent across Modules? 的支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55983299/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com