Google Analytics service Intent crashes on Android Oreo

依然范特西╮ 提交于 2019-11-29 13:10:18
shaishgandhi

I recommend upgrading to play-services version 11.4.0. Add this in your Gradle file:

compile "com.google.android.gms:play-services-analytics:11.4.0

From the Play Services Revision 11.4.0, analytics section:

  • Added a new class AnalyticsJobService. This class provides compatibility support for Android O and is used by Analytics to upload data. No action is necessary to use this class, it’s added automatically as part of the Analytics package.
  • Deprecated the getContext() method of the AnalyticsService class.
  • Deprecated the CampaignTrackingService class.

and also you have to get permission. android:permission="android.permission.BIND_JOB_SERVICE"

See below https://developers.google.com/android/reference/com/google/android/gms/analytics/AnalyticsJobService

because CampaignTrackingService is now Deprecated

just remove this line from your manifest

<service android:name="com.google.android.gms.analytics.CampaignTrackingService"
         android:exported="true"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!