גרסאות של ספרייה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
החל מגרסה 15.0.0, הספריות של Google Play Services מתוחזקות בנפרד, מה שמאפשר לצוותי הפיתוח של כל ספרייה לשלוח תיקונים ושיפורים באופן עצמאי ומהיר יותר. אפשר לעקוב אחרי הגרסאות האחרונות של Google Play Services ושל Firebase.
התאמה מחמירה של גרסאות
יכול להיות שגרסה של ספרייה אחת לא תהיה תואמת לגרסה ספציפית של ספרייה אחרת. כדי לעזור לכם להתמודד עם המצב הזה, יש כמה פלאגינים של Gradle שמספקים הנחיות לגבי אי התאמות בין גרסאות. הלוגיקה בתוספים האלה דומה ללוגיקה של failOnVersionConflict()
כלל עבור ResolutionStrategy
שמשויך לתלות ב-Google Play Services וב-Firebase.
פלאגין של שירותי 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'
כדי להשתמש בתוסף הזה, צריך גם להוסיף את הקוד הבא ל-classpath של buildscript, שמתקבל ממאגר 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'
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-08 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-08-08 (שעון 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"]]