A few days ago we switched our standalone app to use FCM push notifications.
Everything went fine in testing, but when rolling out to the users we’re starting to see crash reports on the Play store. Not had any user complaints yet, and it looks like only about 1/50 have been effected.
The crash seems to be when starting the FCM intent:
java.lang.IllegalStateException:
at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1538)
at android.app.ContextImpl.startService (ContextImpl.java:1484)
at android.content.ContextWrapper.startService (ContextWrapper.java:663)
at host.exp.exponent.fcm.ExpoFcmInstanceIDService.a (ExpoFcmInstanceIDService.java:19)
at com.google.firebase.iid.FirebaseInstanceIdService.b (Unknown Source:12)
at com.google.firebase.iid.k.run (Unknown Source:26)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
at java.lang.Thread.run (Thread.java:764)
Has anyone else seen this or know how to avoid it?
This is on SDK 27.
FWIW the crash reports are all on Android 8. I did see some suggestions that a Firebase library update would help, but as far as I can tell the APK we deployed has firebase 12 (1201 from expo build logs) which should be Oreo compatible.
Essentially the crash appears to be happening when the token refreshes and the app is backgrounded. Oreo doesn’t let you start the FcmRegistrationIntentService from a background service.
This will be why users don’t appear to be complaining - they don’t really notice.