-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background service does not work in SDK 31, app crashes #559
Comments
Having the same issue in SDK 31. |
Just found this Issue. This fixed for me. |
Thank you |
I have forked and released a new version of this library with fixes for android 12 issues |
@hariks789 tried you fix but having other issues, now both on android 10 - 11 and android 12. Android 12 com.android.internal.util.Preconditions in checkArgument at line 59 Android 10 - 11 android.app.LoadedApk$ReceiverDispatcher$Args in lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args at line 1590 NullPointerException com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider$1 in onReceive at line 450 |
@michelevettone Which package version are you using now? I have added a fix for pending intent must be mutable in version 0.7.1. Let me know if that one fixes the first issue For Android 10-11 issues, is there a way to reproduce them I have enabled Issues sections on my fork for discussing this further |
I got an error on this
|
@gomezmark Can you please create an issue on the forked repo with some sample code you use and steps to reproduce this? I will take look into that https://github.com/hariks789/react-native-background-geolocation/issues |
For me on Android 12 the app doesn't crash but the plugin doesn't work in the background mode as in target =<30 |
me too same issue |
Your Environment
Context
When app switch to background, I start background location service to receive location updates in the background.
In Android 9,10,11 all worked perfectly. After upgrade to SDK 31, background location service does not work, app crashes in backround.
Expected Behavior
Background service starts and run successfully in app with targetSdkVersion = 31
Actual Behavior
Background service does not start, app crashed in background:
Possible Fix
Modify https://github.com/mauron85/background-geolocation-android/blob/58464febf6901f1e489817e4425418d48443929b/src/main/java/com/marianhello/bgloc/sync/NotificationHelper.java#L77 and add FLAG_IMMUTABLE
Steps to Reproduce
Context
Debug logs
The text was updated successfully, but these errors were encountered: