Версии библиотеки

As of version 15.0.0, the Google Play services libraries are maintained individually, allowing the development teams for each library to ship fixes and enhancements independently and more quickly. You can track the latest releases for Google Play services and Firebase .

Строгое соответствие версий

A version of one library might be incompatible with a specific version of another library. To help handle this situation, several Gradle plugins provide guidance for these version mismatches. The logic in these plugins is similar to the logic in a failOnVersionConflict() rule for a ResolutionStrategy that's associated with Google Play services and Firebase dependencies.

плагин сервисов Google

Плагин Google Services Gradle проверяет наличие совместимых версий сервисов Google Play и библиотек Firebase.

Автономный плагин для сопоставления версий

Если вы не используете плагин Google Services, но всё же хотите обеспечить строгую проверку версий ваших зависимостей, вы можете применить strict-version-matcher-plugin . Код этого плагина можно посмотреть на GitHub.

Следующий фрагмент кода показывает, как добавить плагин Gradle:

Kotlin DSL

build.gradle.kts

plugins {
    id("com.google.android.gms.strict-version-matcher-plugin")
}

Groovy DSL

build.gradle

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

Для использования этого плагина вам также необходимо добавить в путь к классам вашего скрипта сборки, полученного из репозитория Maven от Google , следующее:

Kotlin DSL

build.gradle.kts

classpath("com.google.android.gms:strict-version-matcher-plugin:1.2.4")

Groovy DSL

build.gradle

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