Library Versions

Beginning with 15.0.0, all Google Play services and Firebase libraries version numbers adhere to the semantic versioning scheme. SemVer is an industry standard for versioning software components, so you can expect version number changes for each library indicate the amount of change in the library.

Each Maven dependency matching com.google.android.gms:play-services-* and com.google.firebase:firebase-*, after 15.0.0, is no longer required to have the same version number in order to work correctly at build time and at run time.

Individual library updates may not be released at the same time - they may be updated and versioned independently. Components may now have a faster cycle for bug fixes and new features.

With these changes in place, you are now able to adopt new versions of the various SDK components more freely, without a strict requirement to update everything at once. It also enables the development teams for each library to ship fixes and enhancements more quickly. Going forward, you can track the releases for Google Play services and Firebase with the provided links.

Remove Old Anti-pattern

With version 15.0.0, a previous common pattern for specifying the shared version number for Google Play services and Firebase dependencies in Gradle builds will no longer work as expected.  The pattern (now anti-pattern) looks like this:

buildscript {
    ext {
        play_version = '15.0.0'
    }
}

dependencies {
    // DON’T DO THIS!!
    // The following use of the above buildscript property is no longer valid.
    implementation "com.google.android.gms:play-services-ads:${play_version}"
    implementation "com.google.android.gms:play-services-auth:${play_version}"
    implementation "com.google.firebase:firebase-firestore:${play_version}"
}

The above Gradle configuration defines a buildscript property called play_version with the version of the Google Play services and Firebase libraries and uses that to declare dependencies.  This pattern had been helpful to keep all the dependency versions together, as previously required.  However, this pattern no longer applies starting with version 15.0.0 for all libraries. Each dependency that you use may now be at different versions.

Strict Version Matching

Not every set of SDK components is compatible across all versions. In order to provide some guidance to deal with version mismatches, functionality has been added to some helper Gradle plugins. The logic employed by the plugins is similar to enabling failOnVersionConflict() ResolutionStrategy for only Google Play services and Firebase dependencies.

Google Services Plugin

In order to support this change in versioning, the Google Services Gradle plugin has been updated. Starting with version 3.3.0, this plugin checks for compatible versions of Google Play services and Firebase libraries.

Standalone Version Matcher Plugin

If you’re not using the Google Services plugin, but you still want strict version checking of your dependencies, you can apply this new Gradle plugin instead:

apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'

In order to use this plugin, you will also need to add the following to your buildscript classpath, obtained from Google’s Maven repository:

classpath 'com.google.android.gms:strict-version-matcher-plugin:1.0.2'

If you’re not using Android Studio 3.1 to develop your app, you will need to upgrade in order to get the correct version checking behavior within the IDE. Get the newest version of Android Studio here.

This plugin's code is available on GitHub.