Firebase Android SDK 对 Google Play 服务的依赖
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
某些 Firebase Android SDK 依赖于 Google Play services,这意味着它们将仅在安装了 Google Play services 的设备和模拟器上运行。这些 Firebase SDK 与设备上的 Google Play services 后台服务通信,以便为您的应用提供最新且安全的轻量级 API。某些 Android 设备(例如 Amazon Kindle Fire 设备或在某些区域出售的设备)未安装 Google Play services。
哪些 Firebase Android SDK 需要 Google Play services?
Firebase SDK 可分为三个类别:
- 需要 Play services - 这些 SDK 需要 Google Play services,否则它们将无法提供功能。
- 推荐使用 Play services - 这些 SDK 需要使用 Google Play services 才能提供完整功能,但即使没有 Google Play services,它们仍可提供大多数功能。
- 不需要 Play services - 这些 SDK 不需要使用 Google Play services 也可提供完整功能。
下表仅列出了每个 SDK 最新版本的要求。某些旧版本可能有更严格的要求。
不需要使用 Google Play services
产品 |
库 |
Google Play services? |
Firebase AI Logic 1 |
com.google.firebase:firebase-ai:17.1.0 |
不需要 |
App Check 自定义和调试提供程序 |
com.google.firebase:firebase-appcheck:19.0.0
com.google.firebase:firebase-appcheck-ktx:18.0.0
com.google.firebase:firebase-appcheck-debug:19.0.0 |
不需要 |
App Distribution API |
com.google.firebase:firebase-appdistribution-api:16.0.0-beta16
com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta15 |
不需要 |
App Distribution |
com.google.firebase:firebase-appdistribution:16.0.0-beta16 |
不需要 |
Authentication |
com.google.firebase:firebase-auth:24.0.1
com.google.firebase:firebase-auth-ktx:23.2.1 |
不需要 |
Cloud Firestore |
com.google.firebase:firebase-firestore:26.0.0
com.google.firebase:firebase-firestore-ktx:25.1.4 |
不需要 |
Cloud Functions for Firebase Client SDK |
com.google.firebase:firebase-functions:22.0.0
com.google.firebase:firebase-functions-ktx:21.2.1 |
不需要 |
Cloud Storage for Firebase |
com.google.firebase:firebase-storage:22.0.0
com.google.firebase:firebase-storage-ktx:21.0.2 |
不需要 |
Crashlytics |
com.google.firebase:firebase-crashlytics:20.0.0
com.google.firebase:firebase-crashlytics-ktx:19.4.4 |
不需要 |
Data Connect |
com.google.firebase:firebase-dataconnect:17.0.0 |
不需要 |
In-App Messaging |
com.google.firebase:firebase-inappmessaging:22.0.0
com.google.firebase:firebase-inappmessaging-ktx:21.0.2 |
不需要
|
In-App Messaging Display |
com.google.firebase:firebase-inappmessaging-display:22.0.0
com.google.firebase:firebase-inappmessaging-display-ktx:21.0.2 |
不需要
|
Firebase 安装 |
com.google.firebase:firebase-installations:19.0.0
com.google.firebase:firebase-installations-ktx:18.0.0 |
不需要 |
Performance Monitoring |
com.google.firebase:firebase-perf:22.0.0
com.google.firebase:firebase-perf-ktx:21.0.5 |
不需要 |
Realtime Database |
com.google.firebase:firebase-database:22.0.0
com.google.firebase:firebase-database-ktx:21.0.0 |
不需要 |
Remote Config |
com.google.firebase:firebase-config:23.0.0
com.google.firebase:firebase-config-ktx:22.1.2 |
不需要 |
Firebase AI Logic 以前称为“Vertex AI in Firebase”,带有软件包 com.google.firebase:firebase-vertexai
。
需要或推荐使用 Google Play services
产品 |
库 |
Google Play services? |
AdMob |
com.google.android.gms:play-services-ads:24.5.0 |
推荐 2 |
Analytics |
com.google.firebase:firebase-analytics:23.0.0
com.google.firebase:firebase-analytics-ktx:22.5.0 |
推荐 2 |
App Check Play Integrity 提供程序 |
com.google.firebase:firebase-appcheck-playintegrity:19.0.0 |
需要 |
App Check SafetyNet 提供程序 |
com.google.firebase:firebase-appcheck-safetynet:16.1.2 |
需要 |
App Indexing |
com.google.firebase:firebase-appindexing:20.0.0 |
需要 |
Cloud Messaging |
com.google.firebase:firebase-messaging:25.0.0
com.google.firebase:firebase-messaging-ktx:24.1.2 |
需要 |
Dynamic Links |
com.google.firebase:firebase-dynamic-links:22.1.0
com.google.firebase:firebase-dynamic-links-ktx:22.1.0 |
需要 |
Firebase ML Vision |
com.google.firebase:firebase-ml-vision:24.1.0 |
需要 |
Firebase ML 自定义模型 |
com.google.firebase:firebase-ml-model-interpreter:22.0.4 |
需要 |
2 Firebase SDK for Google Analytics 可以在任何设备上发送事件,但一些自动分析数据(例如受众特征)仅在具有 Google Play services 的设备上提供。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-17。
[null,null,["最后更新时间 (UTC):2025-08-17。"],[],[],null,["\u003cbr /\u003e\n\nSome Firebase Android SDKs depend on\n[Google Play services](//developers.google.com/android/guides/overview),\nwhich means they will only run on devices and emulators with Google Play services\ninstalled. These Firebase SDKs communicate with the Google Play services background\nservice on the device to provide a secure, up-to-date, and lightweight API to\nyour app. Certain Android devices, such as Amazon Kindle Fire devices or those\nsold in some regions, do not have Google Play services installed.\n| **Note:** The [`google-services` Gradle plugin](//developers.google.com/android/guides/google-services-plugin) is used by all Firebase SDKs, but this plugin is not related to Google Play services.\n\nWhich Firebase Android SDKs require Google Play services?\n\nFirebase SDKs can be divided into three categories:\n\n- **Play services required** --- These SDKs require Google Play services, otherwise they have no functionality.\n- **Play services recommended** --- These SDKs require Google Play services to have *full* functionality, but they still offer *most* functionality even without Google Play services.\n- **Play services not required** --- These SDKS do not require Google Play services to have full functionality.\n\nThe tables below are accurate only for the\n[latest release](/support/release-notes/android#latest_sdk_versions) of each\nSDK. Some older versions may have stricter requirements.\n\nGoogle Play services not required\n\n| Product | Library | Google Play services? |\n|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|\n| Firebase AI Logic ^1^ | com.google.firebase:firebase-ai:17.1.0 | Not Required |\n| App Check custom and debug providers | com.google.firebase:firebase-appcheck:19.0.0 com.google.firebase:firebase-appcheck-ktx:18.0.0 com.google.firebase:firebase-appcheck-debug:19.0.0 | Not Required |\n| App Distribution API | com.google.firebase:firebase-appdistribution-api:16.0.0-beta16 com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta15 | Not Required |\n| App Distribution | com.google.firebase:firebase-appdistribution:16.0.0-beta16 | Not Required |\n| Authentication | com.google.firebase:firebase-auth:24.0.1 com.google.firebase:firebase-auth-ktx:23.2.1 | Not Required |\n| Cloud Firestore | com.google.firebase:firebase-firestore:26.0.0 com.google.firebase:firebase-firestore-ktx:25.1.4 | Not Required |\n| Cloud Functions for Firebase Client SDK | com.google.firebase:firebase-functions:22.0.0 com.google.firebase:firebase-functions-ktx:21.2.1 | Not Required |\n| Cloud Storage for Firebase | com.google.firebase:firebase-storage:22.0.0 com.google.firebase:firebase-storage-ktx:21.0.2 | Not Required |\n| Crashlytics | com.google.firebase:firebase-crashlytics:20.0.0 com.google.firebase:firebase-crashlytics-ktx:19.4.4 | Not Required |\n| Data Connect | com.google.firebase:firebase-dataconnect:17.0.0 | Not Required |\n| In-App Messaging | com.google.firebase:firebase-inappmessaging:22.0.0 com.google.firebase:firebase-inappmessaging-ktx:21.0.2 | Not Required |\n| In-App Messaging Display | com.google.firebase:firebase-inappmessaging-display:22.0.0 com.google.firebase:firebase-inappmessaging-display-ktx:21.0.2 | Not Required |\n| Firebase installations | com.google.firebase:firebase-installations:19.0.0 com.google.firebase:firebase-installations-ktx:18.0.0 | Not Required |\n| Performance Monitoring | com.google.firebase:firebase-perf:22.0.0 com.google.firebase:firebase-perf-ktx:21.0.5 | Not Required |\n| Realtime Database | com.google.firebase:firebase-database:22.0.0 com.google.firebase:firebase-database-ktx:21.0.0 | Not Required |\n| Remote Config | com.google.firebase:firebase-config:23.0.0 com.google.firebase:firebase-config-ktx:22.1.2 | Not Required |\n\n^**1** *Firebase AI Logic was formerly called\n\"Vertex AI in Firebase\" with the package\n`com.google.firebase:firebase-vertexai`.*^\n\nGoogle Play services required or recommended\n\n| Product | Library | Google Play services? |\n|-----------------------------------|---------------------------------------------------------------------------------------------------------|-----------------------|\n| AdMob | com.google.android.gms:play-services-ads:24.5.0 | Recommended ^2^ |\n| Analytics | com.google.firebase:firebase-analytics:23.0.0 com.google.firebase:firebase-analytics-ktx:22.5.0 | Recommended ^2^ |\n| App Check Play Integrity provider | com.google.firebase:firebase-appcheck-playintegrity:19.0.0 | Required |\n| App Check SafetyNet provider | com.google.firebase:firebase-appcheck-safetynet:16.1.2 | Required |\n| App Indexing | com.google.firebase:firebase-appindexing:20.0.0 | Required |\n| Cloud Messaging | com.google.firebase:firebase-messaging:25.0.0 com.google.firebase:firebase-messaging-ktx:24.1.2 | Required |\n| Dynamic Links | com.google.firebase:firebase-dynamic-links:22.1.0 com.google.firebase:firebase-dynamic-links-ktx:22.1.0 | Required |\n| Firebase ML Vision | com.google.firebase:firebase-ml-vision:24.1.0 | Required |\n| Firebase ML Custom Model | com.google.firebase:firebase-ml-model-interpreter:22.0.4 | Required |\n\n^**2** *The Firebase SDK for Google Analytics can send events on any\ndevice, but some automatic insights such as demographics are only available on\ndevices with Google Play services.*^"]]