Google Play 服務中 Firebase Android SDK 的依附元件

部分 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:18.1.0 非必要
App Check 個自訂和偵錯服務 com.google.firebase:firebase-appcheck:20.0.0
com.google.firebase:firebase-appcheck-debug:20.0.0
非必要
App Distribution 個 API com.google.firebase:firebase-appdistribution-api:16.0.0-beta21 非必要
App Distribution com.google.firebase:firebase-appdistribution:16.0.0-beta21 非必要
Authentication com.google.firebase:firebase-auth:25.0.0 非必要
Cloud Firestore com.google.firebase:firebase-firestore:27.1.0 非必要
Cloud Functions for Firebase Client SDK com.google.firebase:firebase-functions:23.0.0 非必要
Cloud Storage for Firebase com.google.firebase:firebase-storage:23.0.0 非必要
Crashlytics com.google.firebase:firebase-crashlytics:21.0.1 非必要
In-App Messaging com.google.firebase:firebase-inappmessaging:23.0.0 非必要
In-App Messaging 螢幕 com.google.firebase:firebase-inappmessaging-display:23.0.0 非必要
Firebase 安裝作業 com.google.firebase:firebase-installations:20.0.0 非必要
Performance Monitoring com.google.firebase:firebase-perf:23.0.1 非必要
Realtime Database com.google.firebase:firebase-database:23.0.0 非必要
Remote Config com.google.firebase:firebase-config:24.0.1 非必要
SQL Connect 2 com.google.firebase:firebase-dataconnect:18.0.1 非必要
已淘汰或不支援的程式庫

Firebase KTX 模組 - 已不再支援

App Check 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-appcheck-ktx:18.0.0
非必要
App Distribution 個 API 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta15
非必要
Authentication 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-auth-ktx:23.2.1
非必要
Cloud Firestore 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-firestore-ktx:25.1.4
非必要
Cloud Functions for Firebase Client SDK 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-functions-ktx:21.2.1
非必要
Cloud Storage for Firebase 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-storage-ktx:21.0.2
非必要
Crashlytics 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-crashlytics-ktx:19.4.4
非必要
In-App Messaging 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-inappmessaging-ktx:21.0.2
com.google.firebase:firebase-inappmessaging-display-ktx:21.0.2
非必要
Firebase 安裝作業 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-installations-ktx:18.0.0
非必要
Performance Monitoring 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-perf-ktx:21.0.5
非必要
Realtime Database 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-database-ktx:21.0.0
非必要
Remote Config 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-config-ktx:22.1.2
非必要

1 Firebase AI Logic 舊稱為「Vertex AI in Firebase」,套件為 com.google.firebase:firebase-vertexai。

2 Firebase SQL Connect 舊稱為「Firebase Data Connect」。

產品 程式庫 Google Play services?
AdMob com.google.android.gms:play-services-ads:25.5.0 建議:3
Analytics com.google.firebase:firebase-analytics:24.0.0 建議:3
App Check Play Integrity 供應商 com.google.firebase:firebase-appcheck-playintegrity:20.0.0 必填
App Check reCAPTCHA 供應商 com.google.firebase:firebase-appcheck-recaptcha:20.0.0 建議
Cloud Messaging com.google.firebase:firebase-messaging:26.0.1 必填
Firebase Phone Number Verification com.google.firebase:firebase-pnv:17.0.0 必填
已淘汰或不支援的程式庫
Dynamic Links com.google.firebase:firebase-dynamic-links: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 必填

Firebase KTX 模組 - 已不再支援

Analytics 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-analytics-ktx:22.5.0
建議:3
Cloud Messaging 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-messaging-ktx:24.1.2
必填
Dynamic Links 請勿使用;系統不再支援 KTX 模組程式庫。
com.google.firebase:firebase-dynamic-links-ktx:22.1.0
必填

3 Google Analytics 的 Firebase SDK 可在任何裝置上傳送事件,但部分自動洞察資料 (例如客層) 僅適用於搭載 Google Play services 的裝置。