Firebase Remote Configを使用してアプリを開発していたのですが、特定の端末でFirebaseRemoteConfig.getInstance().fetch()
に設定したOnCompleteListene
が呼ばれないエラーに遭遇しました。
ログには以下のメッセージが表示されていました。
W/GooglePlayServicesUtil: Google Play services out of date. Requires 11400000 but found 10932448
この時点でGoogle Play Services
が何者か理解していませんでしたし、Firebaseとどのような関係があるのか把握できていませんでした。
Google Play Servicesとは何か
日本語ではGoogle Play 開発者サービス
です。
Google Play 開発者サービスは端末にインストールされているアプリです。
個別のアプリからバージョンを更新することはできません。
ドキュメントは下記にあります。
https://developers.google.com/android/guides/overview
FirebaseとGoogle Play 開発者サービスの関係
ドキュメントの事前準備のところに本日時点(2017/10/11)で以下の記載があります。
事前準備
•Android 4.0(Ice Cream Sandwich)以降、および Google Play 開発者サービス 11.0.4 以降が搭載された端末
Google Play 開発者サービスのリリースノートを確認すると 11.0.4 がリリースされたのは、2017年6月で、最近だということがわかります。
https://developers.google.com/android/guides/releases
Google Play 開発者サービスはいつ更新されるか
ドキュメントにはこのような記載があります。
The Google Play services APK is delivered through the Google Play Store, so updates to the services are not dependent on carrier or OEM system image updates. In general, devices running Android 2.3 (API level 9) or later and have the Google Play services app installed receive updates within a few days. This allows you to use the newest APIs in Google Play services and reach most of the devices in the Android ecosystem. Devices older than Android 2.3 or devices without the Google Play services app are not supported.
ただし、私が開発用に使っている端末の中に更新されてない端末がいくつかあり、本当に全ての端末で更新されているとは言えない気がしています。
まとめ
ドキュメントに記載されているとおり、AndroidのFirebaseはGoogle Play 開発者サービスに依存しています。
Google Play 開発者サービスは基本的に自動で更新されます。
しかし、そうならない端末も存在しているので、可能であればFirebaseを使わないとアプリが使えないような作りは避けたほうが良いと思います。