نسخه های کتابخانه
از نسخه 15.0.0، کتابخانههای خدمات Google Play به صورت جداگانه نگهداری میشوند، که به تیمهای توسعه برای هر کتابخانه اجازه میدهد تا اصلاحات و پیشرفتها را بهطور مستقل و سریعتر ارسال کنند. میتوانید آخرین نسخههای خدمات Google Play و Firebase را ردیابی کنید.
تطبیق دقیق نسخه
ممکن است نسخه ای از یک کتابخانه با نسخه خاصی از کتابخانه دیگر ناسازگار باشد. برای کمک به مدیریت این وضعیت، چندین پلاگین Gradle در مورد این عدم تطابق نسخه ها راهنمایی می کنند. منطق این افزونه ها مشابه منطق یک قانون failOnVersionConflict()
برای ResolutionStrategy
است که با خدمات Google Play و وابستگی های Firebase مرتبط است.
افزونه خدمات گوگل
افزونه Google Services Gradle نسخههای سازگار سرویسهای Google Play و کتابخانههای Firebase را بررسی میکند.
پلاگین تطبیق نسخه مستقل
اگر از افزونه Google Services استفاده نمیکنید، اما همچنان میخواهید نسخه دقیق وابستگیهای خود را بررسی کنید، میتوانید [ 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'
برای استفاده از این افزونه، باید موارد زیر را نیز به مسیر کلاس ساخت اسکریپت خود که از مخزن Maven گوگل به دست آمده است اضافه کنید:
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 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-02-28 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-02-28 بهوقت ساعت هماهنگ جهانی."],[[["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"]]