Google Analytics service Intent crashes on Android Oreo -
i have upgraded app support sdk 26 , google analytics causes crashes when running on android oreo:
fatal exception: java.lang.runtimeexception: unable start receiver com.google.android.gms.analytics.analyticsreceiver: java.lang.illegalstateexception: not allowed start service intent { act=com.google.android.gms.analytics.analytics_dispatch cmp=com.example.android/com.google.android.gms.analytics.analyticsservice }: app in background uid uidrecord{3f302e5 u0a107 rcvr idle procs:1 seq(0,0,0)} @ android.app.activitythread.handlereceiver(activitythread.java:3259) @ android.app.activitythread.-wrap17(unknown source) @ android.app.activitythread$h.handlemessage(activitythread.java:1677) @ android.os.handler.dispatchmessage(handler.java:105) @ android.os.looper.loop(looper.java:164) @ android.app.activitythread.main(activitythread.java:6541) @ java.lang.reflect.method.invoke(method.java) @ com.android.internal.os.zygote$methodandargscaller.run(zygote.java:240) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:767) caused java.lang.illegalstateexception: not allowed start service intent { act=com.google.android.gms.analytics.analytics_dispatch cmp=com.example.android/com.google.android.gms.analytics.analyticsservice }: app in background uid uidrecord{3f302e5 u0a107 rcvr idle procs:1 seq(0,0,0)} @ android.app.contextimpl.startservicecommon(contextimpl.java:1505) @ android.app.contextimpl.startservice(contextimpl.java:1461) @ android.content.contextwrapper.startservice(contextwrapper.java:644) @ android.content.contextwrapper.startservice(contextwrapper.java:644) @ com.google.android.gms.internal.zzaot.onreceive(unknown source:68) @ com.google.android.gms.analytics.analyticsreceiver.onreceive(unknown source:11) @ android.app.activitythread.handlereceiver(activitythread.java:3252) @ android.app.activitythread.-wrap17(unknown source) @ android.app.activitythread$h.handlemessage(activitythread.java:1677) @ android.os.handler.dispatchmessage(handler.java:105) @ android.os.looper.loop(looper.java:164) @ android.app.activitythread.main(activitythread.java:6541) @ java.lang.reflect.method.invoke(method.java) @ com.android.internal.os.zygote$methodandargscaller.run(zygote.java:240) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:767)
this relevant manifest:
<meta-data android:name="com.google.android.gms.analytics.globalconfigresource" android:resource="@xml/analytics"/> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> <!-- optionally, register analyticsreceiver , analyticsservice support background dispatching on non-google play devices --> <receiver android:name="com.google.android.gms.analytics.analyticsreceiver" android:enabled="true"> <intent-filter> <action android:name="com.google.android.gms.analytics.analytics_dispatch"/> </intent-filter> </receiver> <service android:name="com.google.android.gms.analytics.analyticsservice" android:enabled="true" android:exported="false"/> <!-- optionally, register campaigntrackingreceiver , campaigntrackingservice enable installation campaign reporting --> <receiver android:name="com.google.android.gms.analytics.campaigntrackingreceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.install_referrer"/> </intent-filter> </receiver> <service android:name="com.google.android.gms.analytics.campaigntrackingservice" android:exported="true"/>
having hundreds of oreo devices crashing due in past 24 hours. seems affecting on install. going try , add android:permission="android.permission.bind_job_service" 2 analytics services , see. report.
i happy provide more info if needed. thanks
i recommend upgrading play-services version 11.4.0. add in gradle file:
compile "com.google.android.gms:play-services-analytics:11.4.0
from play services revision 11.4.0, analytics section:
- added new class
analyticsjobservice
. class provides compatibility support android o , used analytics upload data. no action necessary use class, it’s added automatically part of analytics package. - deprecated
getcontext()
method ofanalyticsservice
class. - deprecated
campaigntrackingservice
class.
Comments
Post a Comment