גרסאות של ספרייה
החל מגרסה 15.0.0, ספריות Google Play Services מתוחזקות.
בנפרד, כך שצוותי הפיתוח של כל ספרייה יכולים לשלוח תיקונים
ושיפורים באופן עצמאי ובמהירות. אפשר לעקוב אחר
גרסאות של Google Play Services
Firebase.
התאמת גרסאות מחמירה
ייתכן שגרסה של ספרייה אחת לא תואמת לגרסה ספציפית של
על ספרייה אחרת. כדי לעזור לכם במצב הזה, יש כמה יישומי פלאגין של Gradle
הנחיות לגבי אי-התאמות אלה של גרסאות. הלוגיקה ביישומי הפלאגין האלו היא
דומה ללוגיקה בכלל failOnVersionConflict()
עבור
ResolutionStrategy
שמשויכים ל-Google Play Services וליחסי תלות של Firebase.
הפלאגין של שירותי Google
הפלאגין של Google Services Gradle
בודקות אם יש גרסאות תואמות של Google Play Services וספריות של Firebase.
פלאגין להתאמה של גרסה עצמאית
אם אינך משתמש בפלאגין של שירותי Google, אבל עדיין ברצונך להקפיד
בדיקת גרסאות של יחסי התלות, אפשר להחיל
[strict-version-matcher-plugin
]. ניתן לראות את הפלאגין
ב-GitHub.
בקטע הקוד הבא מוסבר איך להוסיף את הפלאגין של Gradle:
build.gradle.kts
plugin {
id("com.google.android.gms.strict-version-matcher-plugin")
}
build.gradle
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
כדי להשתמש בפלאגין הזה, צריך גם להוסיף את הקוד הבא ל
buildscript classpath, שמתקבל מ-Maven של Google
מאגר:
build.gradle.kts
classpath("com.google.android.gms:strict-version-matcher-plugin:1.2.4")
build.gradle
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.4'
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-02-28 (שעון UTC).
[null,null,["עדכון אחרון: 2025-02-28 (שעון 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"]]