mauron85 / react-native-background-geolocation

Background and foreground geolocation plugin for React Native. Tracks user when app is running in background.
Apache License 2.0
1.33k stars 559 forks source link

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

Open TamasFarago opened 2 years ago

TamasFarago commented 2 years ago

Your Environment

Context

Firebase crashlytics reported an error:

Fatal Exception: android.app.RemoteServiceException Context.startForegroundService() did not then call Service.startForeground() android.app.ActivityThread$H.handleMessage (ActivityThread.java:1845) android.os.Handler.dispatchMessage (Handler.java:108) android.os.Looper.loop (Looper.java:206) android.app.ActivityThread.main (ActivityThread.java:6749) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:845)

I don't know why the crash is happening

Expected Behavior

No crash

Actual Behavior

Crash

Possible Fix

Steps to Reproduce

1. 2. 3. 4.

Context

Debug logs

hariks789 commented 2 years ago

I have forked and released a new version of this library with fixes for android 12 issues and this crash. https://www.npmjs.com/package/@hariks789/react-native-background-geolocation Let me know if this fixes your issue

AlessioMTX commented 1 year ago

@hariks789 which is the branch that should work? develop?

chanphiromsok commented 1 year ago

I have forked and released a new version of this library with fixes for android 12 issues and this crash.

https://www.npmjs.com/package/@hariks789/react-native-background-geolocation

Let me know if this fixes your issue

could you make PR ?