Skip to content Skip to sidebar Skip to footer

Gcmbroadcastreceiver Illegalstateexception: Not Allowed To Start Service Intent

I am working on FCM Push notification in Android, where I am getting this exception: GcmBroadcastReceiver IllegalStateException: Not allowed to start service Intent I have search

Solution 1:

You are running on Android 8.0+, with a targetSdkVersion of 26+. You cannot reliably call startService() from the background, such as from a GCM receiver. Instead, you should either:

  • Switch to startForegroundService() and use a foreground service, or

  • Switch to JobIntentService

In your particular case, the code that is calling startService() appears to be from Parse. You should see if there is an update to the Parse client that takes Android 8.0 into account.

Post a Comment for "Gcmbroadcastreceiver Illegalstateexception: Not Allowed To Start Service Intent"