-
Notifications
You must be signed in to change notification settings - Fork 610
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
@capacitor/geolocation sometimes not working #2165
Comments
This issue needs more information before it can be addressed. Please see the Contributing Guide for how to create a Sample App. Thanks! |
Ok, there is it https://github.com/fg1998/geolocation-bug The error occurs occasionally. But the screenshots prove the error. Running on physical device Samsung Galaxy a54 and Samsung Galaxy S10 lite |
I can confirm that users report the same behavior. (Since Capacitor version 6, but it does not necessarily have to be due to the version. The Android hardware or software may also have something to do with it) and I have also seen the error message before. But as already written: Quite sporadic and cannot be firmly defined. |
Yes I can confirm also I'm using physical devices that shows the "location unavailable" error. I did @fg1998's technique of "restarting" the location by opening Google Maps and it works again. |
Bug Report
Plugin(s)
@capacitor/geolocation
Capacitor Version
@capacitor/ios: not installed
@capacitor/cli: 6.1.1
@capacitor/core: 6.1.0
@capacitor/android: 6.1.0
Platform(s)
ANDROID
Current Behavior
Sometimes Geolocation.getCurrentPosition() simples does not provide any coordinates, just return LOCATION UNAVAILABLE. This issue occurs sometimes after install app, or after live run. But not all times.
When this issue occurs, I just open Google Maps and the dot with my current position is GRAY. After 1 or 2 seconds, it became blue and than the error on capacitor does not occur anymore
Code Reproduction
async getCoordenadas() {
try {
const resp = await Geolocation.getCurrentPosition();
}
Other Technical Details
Galaxy A54, Galaxy S9, Galaxy S10 Lite
The text was updated successfully, but these errors were encountered: