rupps
rupps

Reputation: 9887

Migrating support to Android X: Are versions consistent across Modules?

I am migrating a big project to AndroidX.

On my former project, on the top build.gradle, I have defined a variable with the support library version so the 30+ child build.gradle's include the desired support version:

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

My question is, now that I have run the Android X refactoring, I see that dependencies have been converted to different packages under the Android X namespace and even out of it:

    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'

My question is if now with Android X all module versions are synchronized so it makes sense doing in the top gradle:

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

My guess is that modules outside the Android X namespace will have their own version schedule, but I am not even sure that the modules under AndroidX namespace will use common versions.

What do you think?

Upvotes: 1

Views: 477

Answers (1)

ianhanniballake
ianhanniballake

Reputation: 199805

In the AndroidX world, every group (i.e., the part before the first : such as androidx.appcompat) can have a separate version as per the 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.

As seen on the AndroidX releases page, they absolutely do upgrade at different rates, but the semantic versioning requirement ensures that stable versions of the libraries will continue to work together.

Upvotes: 2

Related Questions