Closed fomekong83 closed 3 years ago
I think everyone facing this issue. For me also not working. @mvanbeusekom any update or help on this?
Hi @fomekong83, @chainchelliah,
Personally I think the problem is that your device doesn't get a good connection with the GPS satellites. I noticed that you are using the forceAndroidLocationManager: true
parameter which means the geolocator will use the older Android LocationManager
SDK. When you also specify the desiredAccuracy: LocationAccuracy.high
or desiredAccuracy: LocationAccuracy.best
this will result in the LocationManager
trying to acquire the location using the GPS provider on the device. The problem is that the GPS provider requires a good connection with GPS satellites to acquire the location (usually this means you need to be outdoors).
To work around this you could specify a timeout and switch to LocationAccuracy.medium
which will internally use the Network provider to determine the location which works better in situations where the GPS signal is not stable enough. Unfortunately we don't have an option to read the strength of the GPS signal to determine a more explicit way to switch providers.
I made a small test application based on the default Flutter template that I used to test the problem. If I run the App indoors, with the desiredAccuracy
set to LocationAccuracy.best
, the App keeps showing the "in progress" indicator until I move to a spot where I get a connection with GPS satellites. If I change the desiredAccuracy
to LocationAccuracy.medium
I receive a signal almost immediately.
Take the following steps if you would like to reproduce my test app:
flutter create geo_issue_773
;android/app/main/src/AndroidManifest.xml
file (see my copy below);pubspec.yaml
file (see my copy below);lib/main.dart
with the version provided below.After these steps run the App on your device and hit the "+" button to acquire a location. To change the accuracy update line 36.
I am going to close this issue as the geolocator is working correctly. If you have any questions or problems feel free to leave a comment and I will try my best to provide an answer.
@mvanbeusekom But alas for China, that doesn't work
@mvanbeusekom But alas for China, that doesn't work
use LocationAccuracy.medium, It's It's a problem with GPS signals
@MrWj tks
use LocationAccuracy.medium, It's It's a problem with GPS signals
so magic
ISSUE GETTING USER LOCATION
not returning.
flutter doctor -v
HERE IS MY CODE
THIS IS HOW I CALL IT
I ADDED THESE INTO MY ANDROID MANIFEST
I'M USING geolocator: ^7.2.0+1
MY GRADLE LOOKS LIKE THIS
I'M NEW IN THIS . HELP HELP