程式庫版本
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
自 15.0.0 版起,Google Play 服務程式庫會進行維護
讓每個程式庫的開發團隊都能推送修正程式
以及獨立且快速的增強功能你可以追蹤
Google Play 服務和
Firebase:
嚴格版本比對
其中一個程式庫版本可能與特定版本不相容
另一個程式庫有幾項 Gradle 外掛程式可協助您處理這種情況
提供有關版本不符的指引這些外掛程式中的邏輯是
類似於 failOnVersionConflict()
規則中的邏輯
ResolutionStrategy
與 Google Play 服務和 Firebase 依附元件相關聯的專案
Google 服務外掛程式
Google 服務 Gradle 外掛程式
檢查是否有相容的 Google Play 服務和 Firebase 程式庫版本。
獨立版本比對器外掛程式
如果您並未使用 Google 服務外掛程式,但想採取嚴格措施
檢查依附元件的版本
[strict-version-matcher-plugin
].您可以查看這個外掛程式的
程式碼
下列程式碼片段說明如何新增 Gradle 外掛程式:
Kotlin DSL
build.gradle.kts
plugin {
id("com.google.android.gms.strict-version-matcher-plugin")
}
時髦 DSL
build.gradle
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
若要使用這個外掛程式,您還需要在
從 Google 的 Maven 取得的 buildscript 類別路徑
存放區:
Kotlin DSL
build.gradle.kts
classpath("com.google.android.gms:strict-version-matcher-plugin:1.2.4")
時髦 DSL
build.gradle
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.4'
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-11 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2024-09-11 (世界標準時間)。"],[[["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"]]