java.lang.IllegalStateException: Not allowed to start service Intent / com.google.android.gms.measurement.AppMeasurementService

Paul 296 Reputation points
2021-06-28T16:40:28.02+00:00

Hi everyone, I'm getting this crash logged in App Center for my Xamarin.Forms App (Android),

android.app.ContextImpl.startServiceCommon
ContextImpl.java, line 1720

java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.gms.measurement.UPLOAD cmp=org.myappname.app/com.google.android.gms.measurement.AppMeasurementService (has extras) }: app is in background uid UidRecord{90e48a1 u0a147 RCVR bg:+21m32s364ms idle change:uncached procs:1 seq(598,598,598)}

Seems related to Firebase Analytics as given here. Do I need to add a service tag in my manifest file as mentioned in the Firebase Analytics docs? Or is this addressed in any newer versions. I couldn't find release notes for each FB Analytics SDK versions in https://github.com/xamarin/GooglePlayServicesComponents page.

I'm using Xamarin.Firebase.Analytics 117.0.1 & Xamarin.Forms v5.0.0.1709-pre4 now. Thanks

Developer technologies .NET Xamarin
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.