-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
BackgroundFetch on Android with startOnBoot: true crashes on restart #6290
Comments
face same crashes for app with background location
|
Looks like it's very similar to #6017 . I'm going to close this issue and link back to the original |
So what's our option right now? Stop using |
I guess so - I just find it weird that this has not been fixed yet. Seems like a big problem, especially for those working on transportation apps. |
Yup. That's our exact vertical. We need to track the user's location even when they're not using the app. Funnily enough, I've never personally encountered this issue but there are enough crashes in the Google Console to warrant a fix. |
same issue here, google play console actually flagged our app with Bad Behaviour as this bug is causing a 15% crash rate to our production app. Expo CLI 3.8.0 environment info: 80% of the crash reports are with this error: java.lang.NullPointerException: 15% with this error : java.lang.RuntimeException: 5% with this error : java.lang.RuntimeException: We had to disable location updates until it will get fixed |
Did you find any solution? |
🐛 Bug Report
Environment
Expo CLI 3.7.1 environment info:
System:
OS: macOS 10.14.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.6.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
expo: ^35.0.0 => 35.0.1
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8
npmGlobalPackages:
expo-cli: 3.7.1
I'm building an android app using the managed workflow.
The logs come from Pixel emulator running android 9, but I've reproduced the problem on a real Pixel device running android 10.
Steps to Reproduce
In an expo app, create a BackgroundFetch task, and register it with startOnBoot: true
build an android app with the managed workflow, install the app on the phone
Run the app, make sure that the background task works as expected
( in the example below
adb logcat | grep ReactNative
should showrunning background task
)For example in the https://github.com/jeromecornet/expo-android-backgroundfetch/raw/master/first_run.log, you will see:
11-15 14:02:57.200 4386 4473 I ReactNativeJS: running background task
Restart the phone
the app registers the task again, and starts the timer
for example in https://github.com/jeromecornet/expo-android-backgroundfetch/raw/master/after_reboot.log you will see
Wait 1 minute or so for the task to be executed
Expected Behavior
The task should run, showing the expected console.log line
Actual Behavior
Instead, the standalone app crashes and the background task gets unregistered, the following message appears in the logs instead
From there the task gets unregistered and no longer works until the app is manually started again.
here's a relevant snippet of adb logcat (full log at https://github.com/jeromecornet/expo-android-backgroundfetch/raw/master/after_reboot.log)
Reproducible Demo
I have put a minimal sample app here https://github.com/jeromecornet/expo-android-backgroundfetch. I set the minimumInterval to 1mn for debugging, but I've had the problem with a 15mn interval so I don't believe it's related.
The matching apk (built with
expo build:android
) is here: https://github.com/jeromecornet/expo-android-backgroundfetch/raw/master/app.apkthe full adb logcat output of the app working when executed is at https://github.com/jeromecornet/expo-android-backgroundfetch/raw/master/first_run.log
the full adb logcat output of of the app crashing upon reboot is at https://github.com/jeromecornet/expo-android-backgroundfetch/raw/master/after_reboot.log
The text was updated successfully, but these errors were encountered: