-
-
Notifications
You must be signed in to change notification settings - Fork 708
[Bug]: Geolocator.getCurrentPosition hangs after app restart #1687
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
Comments
How did you test this, on a simulator? Or a real device? Kind regards, |
Real device. Galaxy S23+ At first I thought it was happening only when hot reloading during debugging. However, when running the app alone on the device (debug OR release build), startup was also delayed after closing the app and immediately restarting. |
Can confirm this is an issue. This doesn't happen if I set |
I noticed that when the long hang/timeout occurs, there is no "location" symbol in the top status bar. Once the symbol finally appears, everything proceeds quickly. I wonder what it is "waiting" for? Also, can confirm that "high" does not have the issue. But Low and Medium both do. "reduced" does NOT have the issue either. "hang" times are typically 10-20 seconds. |
I'am not sure about your testing conditions but can you post the LocationSettings that you use, maybe I can try to reproduce this? I cannot reproduce this on my own testing device. Also check if the device has Wifi or a simcard, because otherwise perhaps only the GPS is used, and this might take some time to warmup. Kind regards, |
I do have wifi and sim card, it uses that (no location icon appears on the status bar). |
A) open app, always works fast the first time. If you cannot re-produce, you could load up one of your geolocator files with 'got here 1' print statements, then send it to me and I'll replace and run it and figure out where it hangs at? |
Did some testing... TEST A
TEST B
And then just for reference, although I will not be using high, the lat/lon printed is: 45.3610212 |
Uh oh!
There was an error while loading. Please reload this page.
Please check the following before submitting a new issue.
Please select affected platform(s)
Steps to reproduce
In an Android app, request GeoLocator.getCurrentPosition().
First time is fast. I use "medium".
Then, either kill the app and re-open, or, do a hot reload if debugging.
Second time, or perhaps one or two times after, the app will hang during getCurrentPosition.
Expected results
It should again work fast after killing the app and restarting.
Actual results
After opening the app, closing the app, then re-opening, (maybe cycle that 1-3 times), Geolocator will hang for 16-20 seconds before finally getting a position.
Code sample
Code sample
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
13.0.2
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: