-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Location.startLocationUpdatesAsync task callback does not receive any location updates on Android #28959
Comments
Please also note the same problem being reported in the comments of this issue: This issue was created on request of @brentvatne and the sample app is by @santibernas |
Same question. |
Hi @behenate I am not using the new architecture and I have no issues at all on iOS (unlike the issue you mentioned). However, I am unable to receive any location on Android, neither in a dev build nor in production. |
Can also confirm. Position updates are processed on SDK 50, but not on 51. |
Thank you for filing this issue! |
Prioritize based on severity :-) All Android devices on SDK 51, can't use Location services. |
@tknuts It's a major issue, we'll resolve it asap 🫡 |
+1 |
Issue fixed in the PR above, after we merge it will be published under SDK 51 in a few days (probably sometime after App.js) |
… the JS side (#29024) # Why Location updates wouldn't get passed to the JS side. Turns out the TaskManager is still using the old EventEmitter which doesn't work in SDK51 on Android fixes #28959 fixes #29021 # How Used a similar workaround to use the new EventEmitter as in `expo-av` and `expo-battery` # Test Plan Tested in BareExpo on Android 14 emulator
… the JS side (#29024) # Why Location updates wouldn't get passed to the JS side. Turns out the TaskManager is still using the old EventEmitter which doesn't work in SDK51 on Android fixes #28959 fixes #29021 # How Used a similar workaround to use the new EventEmitter as in `expo-av` and `expo-battery` # Test Plan Tested in BareExpo on Android 14 emulator (cherry picked from commit 5e2fd74)
Minimal reproducible example
https://github.com/santibernas/expo-issue-28767
What platform(s) does this occur on?
Android
Did you reproduce this issue in a development build?
Yes
Summary
When using Location.startLocationUpdatesAsync to register a TaskManager task the task is registered successfully (verified by TaskManager.getRegisteredTasksAsync) but the callback does not ever get called with location data or even an error on Android.
Here are some Logcat insights.
Initially:
Registered task with name 'LocationTask' for app with scoping identifier 'test.app'.
Thereafter every second:
Handling intent with task name 'LocationTask' and app scoping identifier 'test.app'.
Handling job with task name 'LocationTask' for app with scoping identifier 'test.app'.
After a few minutes (usually less than 15) the app runs out of memory and restarts.
On IOS everything works fine and in SDK 50 with the respective package versions of expo-task-manager and expo-location everything was working on Android as well.
Environment
expo-env-info 1.2.0 environment info:
System:
OS: Windows 11 10.0.22631
Binaries:
Node: 20.9.0 - C:\Program Files\nodejs\node.EXE
Yarn: 3.6.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: AI-233.14808.21.2331.11709847
npmPackages:
expo: ~51.0.8 => 51.0.8
react: 18.2.0 => 18.2.0
react-native: 0.74.1 => 0.74.1
Expo Workflow: bare
Expo Doctor Diagnostics
WARNING: We recommend using PowerShell or Bash via WSL 2 for development with Expo CLI on Windows. You may encounter issues using cmd.exe.
✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for issues with metro config
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check that native modules use compatible support package versions for installed Expo SDK
✔ Check that packages match versions required by installed Expo SDK
Didn't find any issues with the project!
The text was updated successfully, but these errors were encountered: