Wersje biblioteki
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Od wersji 15.0.0 biblioteki Usług Google Play są aktualizowane osobno, co pozwala zespołom deweloperskim każdej z nich wprowadzać poprawki i ulepszać je niezależnie i szybciej. Możesz śledzić najnowsze wersje Usług Google Play i Firebase.
Dopasowanie ścisłe wersji
Wersja jednej biblioteki może być niezgodna z konkretną wersją innej biblioteki. Aby pomóc w rozwiązaniu tego problemu, kilka wtyczek Gradle zawiera wskazówki dotyczące tych niezgodności wersji. Logika tych wtyczek jest podobna do logiki reguły failOnVersionConflict()
dla ResolutionStrategy
powiązanej z usługami Google Play i zależnościami Firebase.
Wtyczka usług Google
Wtyczka Google Services Gradle sprawdza, czy istnieją zgodne wersje usług Google Play i bibliotek Firebase.
Samodzielny wtyczka do dopasowywania wersji
Jeśli nie używasz wtyczki Google Services, ale nadal chcesz stosować ścisłą weryfikację wersji zależności, możesz zastosować [strict-version-matcher-plugin
]. Kod wtyczki możesz wyświetlić na GitHub.
Ten fragment kodu pokazuje, jak dodać wtyczkę Gradle:
Kotlin DSL
build.gradle.kts
plugin {
id("com.google.android.gms.strict-version-matcher-plugin")
}
Groovy DSL
build.gradle
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
Aby używać tego wtyczki, musisz też dodać do classpath buildscript informacje uzyskane z repozytorium 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'
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-03-21 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-03-21 UTC."],[[["Google Play services libraries are now individually maintained, allowing for faster and more frequent updates to individual components."],["Strict version matching is crucial as library versions might be incompatible, and the Google Services Gradle plugin and the standalone strict-version-matcher-plugin help manage these dependencies."],["The `strict-version-matcher-plugin` offers a way to ensure version compatibility for Google Play services and Firebase dependencies, even without using the Google Services plugin."],["To utilize the standalone plugin, you need to add it to your buildscript classpath and apply it in your Gradle file using the provided code snippets."]]],["Google Play services libraries are individually maintained, enabling faster updates. To manage potential version incompatibilities between libraries, Gradle plugins provide guidance. The Google Services Gradle plugin checks for compatible versions of Google Play services and Firebase libraries. Alternatively, the `strict-version-matcher-plugin` offers dependency version checking without the Google Services plugin. To use it you must add the plugin and the `strict-version-matcher-plugin` classpath to your build script.\n"]]