Context.startForegroundService() did not then call Service.startForeground()
Related #266 Version v1.4.0 (latest)
Description
I am experiencing this error on production, but it seems that it only happens to Samsung devices according to BugSnag and when they close the app.
android.app.RemoteServiceExceptionMainActivity
Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{df48845 u0 app.puramente.app/com.tanguyantoine.react.MusicControlNotification$NotificationService}
-
Sample code (provide repo url or sample code)
-
Platform ?
- [ ] iOS
- [x] Android
-
Device
- [ ] Simulator
- [x] Real device
+1
+1
+1
Anyone able to investigate and provide some more insight or bug fixes/PRs?
@AugustoAleGon @sturmenta @josh-deprogram
my code worked fine on android 8.1.0, but got the same issue on android 9/10 devices. any update ?
Happening on OnePlus 8T with Android 12.
my code worked fine on android 8.1.0, but got the same issue on android 9/10 devices. any update ?
Fixed by adding notification permissions, it's my fatal...
@fandypeng could you share your solution?
Still the same issue on an Expo client. Crashes 5 seconds after opening the notification as hinted here.
I did not specify a "permission" key in app.json so that the FOREGROUND_SERVICE permission should be granted according to the doc.
Stack trace
Your app just crashed. See the error below.
android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{30aa329 u0 com.paulcombal.playernative/com.tanguyantoine.react.MusicControlNotification$NotificationService}
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2002)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:225)
at android.app.ActivityThread.main(ActivityThread.java:7563)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)