Google Play 服务的 Firebase 分析已过时
Firebase analytics with Google Play Services outdated
我正在将我的应用程序从使用 Google Analytics 迁移到 Google Analytics for Firebase。
我按照教程中的说明设置了一个 Firebase 项目 https://firebase.google.com/docs/android/setup. Then I setup Analytics like this: https://firebase.google.com/docs/analytics/android/start/
我启用了搜索:
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
并使用以下命令尝试在 DebugView (https://support.google.com/firebase/answer/7201382?hl=en&utm_id=ad&authuser=0) 中查看事件:
adb shell setprop debug.firebase.analytics.app com.myapp.mypackage
所有构建和编译,但是当我 运行 设备中的应用程序时,我看到以下日志:
09-17 20:32:48.248 21705-21751/com.myapp.mypackage I/FirebaseInitProvider: FirebaseApp initialization successful
09-17 20:32:48.318 21705-21751/com.myapp.mypackage I/FA: App measurement is starting up, version: 18202
09-17 20:32:48.318 21705-21751/com.myapp.mypackage I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-17 20:32:48.318 21705-21751/com.myapp.mypackage I/FA: Faster debug mode event logging enabled. To disable, run:
adb shell setprop debug.firebase.analytics.app .none.
09-17 20:32:48.328 21705-21751/com.myapp.mypackage D/FA: Debug-level message logging enabled
09-17 20:32:48.548 21705-21763/com.myapp.mypackage I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtilLight.isUninstalledAppPossiblyUpdating
09-17 20:32:48.568 21705-21763/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:48.648 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:48.658 21705-21705/com.myapp.mypackage D/AppFirebaseAnalytics: setUserProperty: upKey: BuildType -> upValue: debug
09-17 20:32:48.668 21705-21705/com.myapp.mypackage D/AppFirebaseAnalytics: setUserProperty: upKey: AppAnalyticsVersion -> upValue: 2.0
09-17 20:32:48.788 21705-21751/com.myapp.mypackage D/FA: Setting user property (FE): BuildType, debug
09-17 20:32:49.018 21705-21751/com.myapp.mypackage D/FA: Setting user property (FE): AppAnalyticsVersion, 2.0
09-17 20:32:49.668 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:32:49.678 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to send app launch
09-17 20:32:49.688 21705-21751/com.myapp.mypackage E/FA: Failed to get app instance id
09-17 20:32:49.688 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to set user attribute
09-17 20:32:49.688 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to set user attribute
09-17 20:32:49.688 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to set user attribute
09-17 20:32:49.878 21705-21751/com.myapp.mypackage I/FA: Tag Manager is not found and thus will not be used
09-17 20:32:50.138 21705-21751/com.myapp.mypackage D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_screen_class(_sc)=AppBootActivity, ga_screen_id(_si)=3005854567277075178}]
09-17 20:32:50.288 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:50.288 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:32:50.298 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:50.308 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:32:50.318 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:32:50.318 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:32:50.318 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:32:54.668 21705-21751/com.myapp.mypackage D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=AppBootActivity, ga_previous_id(_pi)=3005854567277075178, ga_screen_class(_sc)=ScreenLauncherActivity, ga_screen_id(_si)=3005854567277075179}]
09-17 20:32:54.768 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:56.948 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:32:56.958 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:32:56.958 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:32:56.968 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:33:19.048 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:33:19.138 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:33:19.148 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:33:22.708 21705-21705/com.myapp.mypackage D/AppFirebaseAnalytics: logEvent: eventName: Screen_Launcher -> infoBundle: Bundle[{action=Expand, label=temperatures}]
09-17 20:33:22.768 21705-21751/com.myapp.mypackage D/FA: Logging event (FE): Screen_Launcher, Bundle[{action=Expand, ga_event_origin(_o)=app, ga_screen_class(_sc)=ScreenLauncherActivity, ga_screen_id(_si)=3005854567277075179, label=temperatures}]
09-17 20:33:22.818 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:33:22.908 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:33:22.918 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:38:22.738 21705-23662/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:38:22.778 21705-23662/com.myapp.mypackage D/FA: Logging event (FE): user_engagement(_e), Bundle[{ga_event_origin(_o)=auto, engagement_time_msec(_et)=303709, ga_screen_class(_sc)=ScreenLauncherActivity, ga_screen_id(_si)=3005854567277075179}]
09-17 20:38:22.798 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:38:23.118 21705-23662/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:38:23.128 21705-23662/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:38:23.128 21705-23662/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:38:23.158 21705-23662/com.myapp.mypackage D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=ScreenLauncherActivity, ga_previous_id(_pi)=3005854567277075179, ga_screen_class(_sc)=ScreenSaverActivity, ga_screen_id(_si)=3005854567277075180}]
09-17 20:38:23.178 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:38:23.208 21705-23662/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:38:23.218 21705-23662/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:38:23.218 21705-23662/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:38:23.258 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:39:08.618 21705-21705/com.myapp.mypackage D/AppFirebaseAnalytics: logEvent: eventName: Standby -> infoBundle: Bundle[{action=Click, label=Standby}]
09-17 20:39:08.668 21705-23896/com.myapp.mypackage D/FA: Logging event (FE): Standby, Bundle[{action=Click, ga_event_origin(_o)=app, ga_screen_class(_sc)=ScreenSaverActivity, ga_screen_id(_si)=3005854567277075180, label=Standby}]
09-17 20:39:08.728 21705-23896/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:39:08.808 21705-23896/com.myapp.mypackage D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=ScreenSaverActivity, ga_previous_id(_pi)=3005854567277075180, ga_screen_class(_sc)=ScreenLauncherActivity, ga_screen_id(_si)=3005854567277075179}]
09-17 20:39:08.848 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:39:08.878 21705-23896/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:39:08.898 21705-23896/com.myapp.mypackage D/FA: Logging event (FE): user_engagement(_e), Bundle[{ga_event_origin(_o)=auto, engagement_time_msec(_et)=45904, ga_screen_class(_sc)=ScreenSaverActivity, ga_screen_id(_si)=3005854567277075180}]
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:39:09.178 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
Firebase 控制台的 DebugView 中没有任何事件。
每次我执行记录事件的操作时,它都会抱怨 Google Play 服务。
应用 运行s 未部署到 Play 商店的设备,因此它可能 Google Play 服务已过时,甚至不存在,我们不想强制我们的用户 update/install 它。
从日志来看,似乎 FirebaseApp 初始化成功,但随后的日志显示 Failed to get app instance id
...
我做了一些研究,在某些情况下我发现 Firebase Analytics 需要更新 Google Play 服务(),但在其他一些情况下,它看起来应该可以工作:
- https://blog.novoda.com/firebase-on-amazon-devices/
- https://github.com/firebase/quickstart-unity/issues/223#issuecomment-520908309
我的问题是:
- 我可以在没有 Google Play 服务或使用过时版本的情况下使用 Firebase Analytics 吗?
- 如果是,可能是什么问题?一些配置?
我最终让它发挥作用,但不确定以下哪些更改起到了作用。
所做的更改:
- 在 Firebase 控制台的“项目设置”>“常规”中,我添加了 SHA 证书指纹,这在之前是不存在的:
- 下载了新的 google-services.json,在项目中替换它并在 "services" 中添加以下键:
- 已从 AndroidManifest.xml
中删除 <meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
此外,即使按照前面的描述,有时我会在我的开发设备上遇到这些错误...花了一些时间后,我从系统设置中删除了应用程序数据,它开始发送再次发生事件。
我正在将我的应用程序从使用 Google Analytics 迁移到 Google Analytics for Firebase。
我按照教程中的说明设置了一个 Firebase 项目 https://firebase.google.com/docs/android/setup. Then I setup Analytics like this: https://firebase.google.com/docs/analytics/android/start/
我启用了搜索:
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
并使用以下命令尝试在 DebugView (https://support.google.com/firebase/answer/7201382?hl=en&utm_id=ad&authuser=0) 中查看事件:
adb shell setprop debug.firebase.analytics.app com.myapp.mypackage
所有构建和编译,但是当我 运行 设备中的应用程序时,我看到以下日志:
09-17 20:32:48.248 21705-21751/com.myapp.mypackage I/FirebaseInitProvider: FirebaseApp initialization successful
09-17 20:32:48.318 21705-21751/com.myapp.mypackage I/FA: App measurement is starting up, version: 18202
09-17 20:32:48.318 21705-21751/com.myapp.mypackage I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-17 20:32:48.318 21705-21751/com.myapp.mypackage I/FA: Faster debug mode event logging enabled. To disable, run:
adb shell setprop debug.firebase.analytics.app .none.
09-17 20:32:48.328 21705-21751/com.myapp.mypackage D/FA: Debug-level message logging enabled
09-17 20:32:48.548 21705-21763/com.myapp.mypackage I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtilLight.isUninstalledAppPossiblyUpdating
09-17 20:32:48.568 21705-21763/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:48.648 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:48.658 21705-21705/com.myapp.mypackage D/AppFirebaseAnalytics: setUserProperty: upKey: BuildType -> upValue: debug
09-17 20:32:48.668 21705-21705/com.myapp.mypackage D/AppFirebaseAnalytics: setUserProperty: upKey: AppAnalyticsVersion -> upValue: 2.0
09-17 20:32:48.788 21705-21751/com.myapp.mypackage D/FA: Setting user property (FE): BuildType, debug
09-17 20:32:49.018 21705-21751/com.myapp.mypackage D/FA: Setting user property (FE): AppAnalyticsVersion, 2.0
09-17 20:32:49.668 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:32:49.678 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to send app launch
09-17 20:32:49.688 21705-21751/com.myapp.mypackage E/FA: Failed to get app instance id
09-17 20:32:49.688 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to set user attribute
09-17 20:32:49.688 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to set user attribute
09-17 20:32:49.688 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to set user attribute
09-17 20:32:49.878 21705-21751/com.myapp.mypackage I/FA: Tag Manager is not found and thus will not be used
09-17 20:32:50.138 21705-21751/com.myapp.mypackage D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_screen_class(_sc)=AppBootActivity, ga_screen_id(_si)=3005854567277075178}]
09-17 20:32:50.288 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:50.288 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:32:50.298 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:50.308 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:32:50.318 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:32:50.318 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:32:50.318 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:32:54.668 21705-21751/com.myapp.mypackage D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=AppBootActivity, ga_previous_id(_pi)=3005854567277075178, ga_screen_class(_sc)=ScreenLauncherActivity, ga_screen_id(_si)=3005854567277075179}]
09-17 20:32:54.768 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:32:56.948 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:32:56.958 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:32:56.958 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:32:56.968 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:33:19.048 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:33:19.138 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:33:19.148 21705-21751/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:33:22.708 21705-21705/com.myapp.mypackage D/AppFirebaseAnalytics: logEvent: eventName: Screen_Launcher -> infoBundle: Bundle[{action=Expand, label=temperatures}]
09-17 20:33:22.768 21705-21751/com.myapp.mypackage D/FA: Logging event (FE): Screen_Launcher, Bundle[{action=Expand, ga_event_origin(_o)=app, ga_screen_class(_sc)=ScreenLauncherActivity, ga_screen_id(_si)=3005854567277075179, label=temperatures}]
09-17 20:33:22.818 21705-21751/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:33:22.908 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:33:22.918 21705-21751/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:38:22.738 21705-23662/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:38:22.778 21705-23662/com.myapp.mypackage D/FA: Logging event (FE): user_engagement(_e), Bundle[{ga_event_origin(_o)=auto, engagement_time_msec(_et)=303709, ga_screen_class(_sc)=ScreenLauncherActivity, ga_screen_id(_si)=3005854567277075179}]
09-17 20:38:22.798 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:38:23.118 21705-23662/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:38:23.128 21705-23662/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:38:23.128 21705-23662/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:38:23.158 21705-23662/com.myapp.mypackage D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=ScreenLauncherActivity, ga_previous_id(_pi)=3005854567277075179, ga_screen_class(_sc)=ScreenSaverActivity, ga_screen_id(_si)=3005854567277075180}]
09-17 20:38:23.178 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:38:23.208 21705-23662/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:38:23.218 21705-23662/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:38:23.218 21705-23662/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:38:23.258 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:39:08.618 21705-21705/com.myapp.mypackage D/AppFirebaseAnalytics: logEvent: eventName: Standby -> infoBundle: Bundle[{action=Click, label=Standby}]
09-17 20:39:08.668 21705-23896/com.myapp.mypackage D/FA: Logging event (FE): Standby, Bundle[{action=Click, ga_event_origin(_o)=app, ga_screen_class(_sc)=ScreenSaverActivity, ga_screen_id(_si)=3005854567277075180, label=Standby}]
09-17 20:39:08.728 21705-23896/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:39:08.808 21705-23896/com.myapp.mypackage D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=ScreenSaverActivity, ga_previous_id(_pi)=3005854567277075180, ga_screen_class(_sc)=ScreenLauncherActivity, ga_screen_id(_si)=3005854567277075179}]
09-17 20:39:08.848 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
09-17 20:39:08.878 21705-23896/com.myapp.mypackage W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 4325038
09-17 20:39:08.898 21705-23896/com.myapp.mypackage D/FA: Logging event (FE): user_engagement(_e), Bundle[{ga_event_origin(_o)=auto, engagement_time_msec(_et)=45904, ga_screen_class(_sc)=ScreenSaverActivity, ga_screen_id(_si)=3005854567277075180}]
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Failed to send current screen to service
09-17 20:39:08.948 21705-23896/com.myapp.mypackage E/FA: Discarding data. Failed to send event to service
09-17 20:39:09.178 21705-21705/com.myapp.mypackage W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
Firebase 控制台的 DebugView 中没有任何事件。
每次我执行记录事件的操作时,它都会抱怨 Google Play 服务。
应用 运行s 未部署到 Play 商店的设备,因此它可能 Google Play 服务已过时,甚至不存在,我们不想强制我们的用户 update/install 它。
从日志来看,似乎 FirebaseApp 初始化成功,但随后的日志显示 Failed to get app instance id
...
我做了一些研究,在某些情况下我发现 Firebase Analytics 需要更新 Google Play 服务(
- https://blog.novoda.com/firebase-on-amazon-devices/
- https://github.com/firebase/quickstart-unity/issues/223#issuecomment-520908309
我的问题是:
- 我可以在没有 Google Play 服务或使用过时版本的情况下使用 Firebase Analytics 吗?
- 如果是,可能是什么问题?一些配置?
我最终让它发挥作用,但不确定以下哪些更改起到了作用。
所做的更改:
- 在 Firebase 控制台的“项目设置”>“常规”中,我添加了 SHA 证书指纹,这在之前是不存在的:
- 下载了新的 google-services.json,在项目中替换它并在 "services" 中添加以下键:
- 已从 AndroidManifest.xml 中删除
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
此外,即使按照前面的描述,有时我会在我的开发设备上遇到这些错误...花了一些时间后,我从系统设置中删除了应用程序数据,它开始发送再次发生事件。