react-native-music-control icon indicating copy to clipboard operation
react-native-music-control copied to clipboard

Context.startForegroundService() did not then call Service.startForeground()

Open nahuelb opened this issue 4 years ago • 9 comments

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}
  1. Sample code (provide repo url or sample code)

  2. Platform ?

    • [ ] iOS
    • [x] Android
  3. Device

  • [ ] Simulator
  • [x] Real device

nahuelb avatar Jul 27 '21 20:07 nahuelb

+1

AugustoAleGon avatar Jul 29 '21 15:07 AugustoAleGon

+1

sturmenta avatar Jul 30 '21 13:07 sturmenta

+1

josh-deprogram avatar Aug 03 '21 00:08 josh-deprogram

Anyone able to investigate and provide some more insight or bug fixes/PRs?

@AugustoAleGon @sturmenta @josh-deprogram

bradfloodx avatar Aug 03 '21 02:08 bradfloodx

my code worked fine on android 8.1.0, but got the same issue on android 9/10 devices. any update ?

fandypeng avatar Mar 16 '22 08:03 fandypeng

Happening on OnePlus 8T with Android 12.

Nyrox avatar May 12 '22 14:05 Nyrox

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 avatar Jun 10 '22 08:06 fandypeng

@fandypeng could you share your solution?

rafaelmaeuer avatar Jul 19 '22 12:07 rafaelmaeuer

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)

PaulCombal avatar Aug 18 '22 18:08 PaulCombal