Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

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

Open
2 of 4 tasks
nahuelb opened this issue Jul 27, 2021 · 9 comments
Open
2 of 4 tasks

Comments

@nahuelb
Copy link

nahuelb commented Jul 27, 2021

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
    • Android
  3. Device

  • Simulator
  • Real device
@AugustoAleGon
Copy link

+1

2 similar comments
@sturmenta
Copy link

+1

@josh-deprogram
Copy link

+1

@bradfloodx
Copy link
Collaborator

bradfloodx commented Aug 3, 2021

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

@AugustoAleGon @sturmenta @josh-deprogram

@fandypeng
Copy link

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

@Nyrox
Copy link

Nyrox commented May 12, 2022

Happening on OnePlus 8T with Android 12.

@fandypeng
Copy link

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...

@rafaelmaeuer
Copy link
Contributor

@fandypeng could you share your solution?

@PaulCombal
Copy link

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants