-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 provider is unavailable. Make sure that location services are enabled. #14248
Comments
Same thing here, no changes and all of sudden it stops working, but not for everyone and not all the time. Here's how we get the location: none of accuracy settings work:
SDK is 40 |
Same with SDK41/managed, started erroring today morning, worked fine until then. Some people reported that {accuracy: 6} or {Location.Accuracy.Low} or {Location.Accuracy.Lowest} worked for them. For us they did not, so we had to change getCurrentPositionAsync() to getLastKnownPositionAsync() everywhere. It's worth to note that some developers reported the issue starting a week ago others just now. Might be related to an android update? |
We are tracking devices that are having this issue. |
This fails for me on my Pixel 3, so it seems to affect more than just Samsung. |
Yes, we do have a Pixel 3 in our list too. |
Also on my LG |
also on my Xiaomi Poco X3 |
I have this issue on Huawei using expo 42 |
Same issue just started happening after few months of it working fine. I did a gradlew clean and reinstalled the app and now the location on Pixel 4 returns :Error: Location provider is unavailable. Make sure that location services are enabled. On Pixel 2 is working fine. There has been no code changes to this for few months. |
Nokia 8 Sirocco (SDK 41) also has the same issue; no changes in code were made. |
We have also had some iOS devices getting this issue, based on Sentry data. |
Samsung Galaxy s9+ (SDK 41) also has the same issue; no changes in code were made. |
@Gautam-24 Only workaround that's working for us is to use Here's a our current implementation, preferring last known.
|
hi Thanks for your response can we please connect i am still facing issues.. https://meet.google.com/jxg-zuhh-cpy thanks |
We are up to 103 users and climbing. |
Same here. I Tryed with everything, emulators, real devices, restarting phone makes it work but only the first time, then the error comes back. Workaround that worked for me (but is not suitable for my projects): set the accuracy to "lowest".
I'm using Xiaomi Mi 8 Lite, Moto G4 Play, Pixel 4 (emulator). |
Just to add my experience with this issue to the data collection - the (Other aspects of my app works) Samsung Galaxy S7, SDK 41 |
I've had this issue with different accuracy settings on different Samsung phones. I've been trying the above suggestion of falling back to the last known location, but that doesn't seem to be a sufficient solution as the last known location might not be available when the app is first used for quite some time. Some people have suggested simply switching to a different accuracy level, but this also fails to solve the problem as different devices seem to fail with different accuracy settings. I've found an odd solution that seems to solve the problem... spamming the phone for location for one accuracy setting. So, if It doesn't take long for the app to go through these 21 iterations, so the location is found pretty quickly. This seems like a ridiculous thing to have to do, but for now it seems to be the only solution. ... btw if you want to deal with promises in a more elegant way, checkout https://dzone.com/articles/promises-that-dont-fail . It allows you to do away with tedious promise notation and try-catch blocks and simply do async-await functions with if-else blocks. I was able to do a Software upgrade on one of the two Samsungs I'm testing with. It now only takes one try to get the location. The other requires the spamming solution. |
Code solution for the above:
This assumes that you store the result of You can replace I actually use React Context instead of a component, but that is just my way of doing it. Turn the above into what you need for your scenario. |
Thank you for the suggestion but trying for 50 times isn't an ideal scenario for us and is more if a workaround than solution. Our clients are already disappointed in waiting for location locks before this happened. We have a smaller scale version of what you are doing here, just not that many tries, and we still get locks failing in places. As for our own research, we found on one device that going back to Google Play Services 16.0.89 from July fixes the issues. Google Play Services plays a part in location acquisition on Google Play enabled devices, and Expo requires it from the logs I pulled from Android while trying on an AOSP device. My working theory is that Google updated Play Services and broke something. |
# Why Fixing issue [#14248](#14248) # How Changed location callback flow. # Test Plan - tested automatically via a test suite - tested manually in bare-app (covered cases, when location is enabled and disabled) # Checklist - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.io and README.md). - [x] This diff will work correctly for `expo build` (eg: updated `@expo/xdl`). - [x] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin).
Same here. After uninstalling Google Play Services 21.30.16 location is working again. |
It looks like @lukmccall pushed some changes about this to master. Are they going to be available to 41, 40 SDK's? |
Fixed by #14281. The fix will be available in the next SDK. Unfortunately, we don't plan to backport this fix to the older SDKs. |
Wait, what?! We didn't have any possibility to check if your fixes work, and you closing this? I mean you could not possibly check it on all devices we listed (and I mean real devices)). SDK 42 is not even half a year old, so most applications still use 40/41. We are talking about production applications and paying expo money for build (so not about you working for free), at least in the case of the application I work on. |
I have a question... in versions prior to expo 42, location worked correctly, after updating the problems began. my question is: ¿rollback expo to 38 possible, and doing this could avoid this issues? |
My understanding is that this is to do with the version of Google Play services on the device and nothing to do with the Expo SDK version. So downgrading the Expo SDK will not fix the problem. If you go into the device settings and find the "Google Play services" app and check the version you will see something like this:
If I check the info in the Play Store it says:
|
…provider (#14354) * [android][location] getCurrentPositionAsync issue fix (#14281) Fixing issue [#14248](#14248) Changed location callback flow. - tested automatically via a test suite - tested manually in bare-app (covered cases, when location is enabled and disabled) - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.io and README.md). - [x] This diff will work correctly for `expo build` (eg: updated `@expo/xdl`). - [x] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin). * [location] Backport google services workaround for location provider Co-authored-by: Kamil Owczarz <kamil.owczarz@swmansion.com>
…provider (#14355) * [android][location] getCurrentPositionAsync issue fix (#14281) Fixing issue [#14248](#14248) Changed location callback flow. - tested automatically via a test suite - tested manually in bare-app (covered cases, when location is enabled and disabled) - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.io and README.md). - [x] This diff will work correctly for `expo build` (eg: updated `@expo/xdl`). - [x] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin). * [location] Backport google services workaround for location provider Co-authored-by: Kamil Owczarz <kamil.owczarz@swmansion.com>
…provider (#14356) * [android][location] getCurrentPositionAsync issue fix (#14281) # Why Fixing issue [#14248](#14248) # How Changed location callback flow. # Test Plan - tested automatically via a test suite - tested manually in bare-app (covered cases, when location is enabled and disabled) # Checklist - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.io and README.md). - [x] This diff will work correctly for `expo build` (eg: updated `@expo/xdl`). - [x] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin). * [location] Backport google services workaround for location provider Co-authored-by: Kamil Owczarz <kamil.owczarz@swmansion.com>
Edit, the Expo Go binaries are available through the Expo CLI. Turtle has been updated with new shell apps as well. Create a new build with Managed workflow
Here is a quick overview of the SDK and the Expo Go version you should be getting, and if it includes the workaround when building with
Bare workflow (or EAS)If you are using the bare workflow, make sure you installed Alternatively, you can apply the patch from #14281 manually using |
Would it be possible to get more details on what the workaround is, how it fixes the problem, etc? |
Does this mean that we won't need to upgrade our SDK version or the |
I think I'm missing something - we're using the managed workflow and I've run the However, I'm still also seeing "Client version: 2.21.5" in my Expo Go app, which is why I assume I'm missing something. Any advice is appreciated! |
I noticed that builds on expo, even when the package is pointing at 12.1.3, are building 12.1.2. Lost on how to continue. |
Have you upgrade expo to 42.0.3? in the process reinstall explo-cli from emulator (also updates the expo go app from your device). When i do this, location is back to my projects, also the signed builds, Don't Forget that now |
@byCedric Does this mean there will be no patch for Expo 39 or is it still in the works? |
|
Double-check if a simulator or other device is connected. It will only install on the first device listed from |
I can't reproduce this issue, both with and without the wifi/bluetooth scanning the location is returned. If you think this is an issue with Expo, please open a new issue with a reproducible example. Happy to take a look! |
Unfortunately, the SDK 39 version didn't pass the tests. Although the location worked fine with the workaround, there were other issues. I hope to push out a newer version for SDK 39 somewhere next week. Also, be aware that SDK 39 is going to be deprecated once we launch SDK 43. I would heavily recommend upgrading to SDK 40 or higher. |
Hi everyone, I will lock the thread to keep this answer "findable" for everyone. To reiterate on #14248 (comment): Status
Managed workflowTo install the new Expo Go binaries:
To upgrade your app with the workaround, create a new build with
Bare workflow (and EAS projects)If you are using the bare workflow or EAS to build your app, make sure you installed Example projectBecause some of you weren't sure if the workaround solved the issue, I created an example project for you to test with. It's a simple managed app to fetch your location. You can change the You can find the APKs with the workaround in these workflows: |
Summary
We have what has been a stable application for months that requires location services. As of last week, we are seeing a massive influx of reports that location is not working, which breaks one of the primary functions of the application. This is not just a few people, but hundreds. We have two places in our application that requires location. It will work the first time, but not the second. Many times it will not work at all. Sometimes retrying 15-20 times allows it to work. This is causing serious issues for our business clients.
We are using SDK 40, as we are still vetting 41. I have seen reports of this happening to others even in SDK 42.
#5504
There have been no changes to this application in months.
We were able to pull this log on a failed attempt:
{ "nativeStackAndroid":[ { "lineNumber":2, "file":"LocationModule.java", "methodName":"onLocationAvailability", "class":"expo.modules.location.LocationModule$1" }, { "lineNumber":4, "file":null, "methodName":"a", "class":"d.f.b.e.f.m.w" }, { "lineNumber":3, "file":"com.google.android.gms:play-services-base@@17.3.0", "methodName":"d", "class":"com.google.android.gms.common.api.internal.k" }, { "lineNumber":3, "file":"com.google.android.gms:play-services-base@@17.3.0", "methodName":"handleMessage", "class":"com.google.android.gms.common.api.internal.k$c" }, { "lineNumber":105, "file":"Handler.java", "methodName":"dispatchMessage", "class":"android.os.Handler" }, { "lineNumber":1, "file":"com.google.android.gms:play-services-base@@17.3.0", "methodName":"dispatchMessage", "class":"d.f.b.e.f.d.h" }, { "lineNumber":164, "file":"Looper.java", "methodName":"loop", "class":"android.os.Looper" }, { "lineNumber":8, "file":"MessageQueueThreadImpl.java", "methodName":"run", "class":"com.facebook.react.bridge.queue.MessageQueueThreadImpl$4" }, { "lineNumber":764, "file":"Thread.java", "methodName":"run", "class":"java.lang.Thread" } ], "userInfo":null, "message":"Location provider is unavailable. Make sure that location services are enabled.", "code":"E_LOCATION_UNAVAILABLE", "line":27, "column":1111, "sourceURL":"" }
Managed or bare workflow? If you have
ios/
orandroid/
directories in your project, the answer is bare!managed
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
40
Environment
Expo CLI 4.11.0 environment info:
System:
OS: Windows 10 10.0.22000
Binaries:
Node: 14.17.0 - C:\Program Files\nodejs\node.EXE
Yarn: 2.4.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
npmPackages:
expo: ^40.0.0 => 40.0.0
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2
react-native-web: ~0.13.12 => 0.13.18
Expo Workflow: managed
Reproducible demo or steps to reproduce from a blank project
Create a project with proper permissions for fine location.
let location = await Location.getCurrentPositionAsync({ accuracy: LocationAccuracy.Low });
BestForNavigation, Highest, High all work. We have only tested this in our own source code.
This is how we have been able to readily reproduce it.
This throws the same exception for us ( in an Android emulator with the following setup:
Connected to wifi.
Location permission set as "Allow while using the app" in settings.
No location/ points saved in emulator.
Emulator details: Nexus6, Android API R x86
We cannot readily reproduce it in the production application, however nothing has changed since July 2021.
The text was updated successfully, but these errors were encountered: