Posted yesteryear Doug Stevenson, Developer Advocate
Starting today, the Android SDKs for Google Play services together with Firebase volition live on using a novel construct together with versioning scheme. This may require around changes to the means yous construct your Android app, together with then live on certain to read hither thoroughly to larn all the details.
Here's a quick summary of what's novel inwards these SDKs:
- All dependencies at in ane lawsuit purpose semantic versioning.
- Each dependency may live on updated individually, removing the require to upgrade them all simultaneously inwards your app.
- Each dependency has a faster cycle for põrnikas fixes together with novel features.
Beginning alongside version xv of all Play services together with Firebase libraries, version numbers adhere to the semantic versioning scheme. As yous know, semver is an manufacture measure for versioning software components, together with then yous tin hold back that version position out changes for each library betoken the amount of alter inwards the library.
Each Maven dependency matching com.google.android.gms:play-services-*
together with com.google.firebase:firebase-*
is no longer required to bring the same version position out inwards companionship to operate correctly at construct fourth dimension together with at run time. You volition live on able to upgrade each dependency independently from each other. As such, a mutual designing for specifying the shared version position out for Play together with Firebase dependencies inwards Gradle builds volition no longer operate equally expected. The designing (now anti-pattern) looks similar this:
buildscript { ext { play_version = '15.0.0' } } dependencies { // DON'T DO THIS!! // The next purpose of the higher upward buildscript belongings is no longer valid. implementation "com.google.android.gms:play-services-auth:${play_version}" implementation "com.google.firebase:firebase-auth:${play_version}" implementation "com.google.firebase:firebase-firestore:${play_version}" }
The higher upward Gradle configuration defines a buildscript belongings called play_version
alongside the version of the Play together with Firebase SDKs, together with uses that to declare dependencies. This designing has been helpful to proceed all the dependency versions together, equally previously required. However, this designing no longer applies starting alongside version xv for each library. Each dependency that yous purpose may at in ane lawsuit live on at unlike versions. You tin hold back that private library updates may non live on released at the same fourth dimension - they may live on updated independently.
In companionship to back upward this alter inwards versioning, the Play services Gradle plugin has been updated. If you're using this plugin, it appears similar this at the bottom of build.gradle
inwards your app module:
apply plugin: 'com.google.gms.google-services'
Here is what has changed inwards this plugin:
- It checks for compatible versions of Play together with Firebase libraries. This is similar to enabling the
failOnVersionConflict()
ResolutionStrategy. - Licensing data is embedded inwards each private construct artifact. If yous purpose the oss-licenses plugin to create create license requirements, yous should update it to the latest.
The source version of this plugin that plant alongside the novel versioning organization is 3.3.0. When working alongside the novel versions of Play together with Firebase libraries, it should live on added to your buildscript classpath dependencies equally follows:
classpath 'com.google.gms:google-services:3.3.0'
If you're non using this plugin, simply yous withal desire strict version checking of your dependencies, yous tin apply this novel Gradle plugin instead:
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
In companionship to purpose this plugin, yous volition equally good require to add together the next to your buildscript classpath, obtained from Google's Maven Repository:
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.0.0'
If you're non using Android Studio 3.1 to prepare your app, yous volition require to upgrade inwards companionship to larn the right version checking demeanour inside the IDE. Get the newest version of Android Studio here.
With these changes inwards place, yous are at in ane lawsuit able to adopt novel versions of the diverse SDKs to a greater extent than freely, without a strict requirement to update everything at once. It equally good enables the evolution teams for each SDK to shipping fixes together with enhancements to a greater extent than quickly. Going forward, yous tin rail the releases for Play services SDKs together with Firebase SDKs alongside the provided links.