flutter-geolocator
flutter-geolocator copied to clipboard
Location time is too long
🐛 Bug Report
Hi, I use getCurrentPosition to locate, but the call takes about 120s.
I tried multiple times but every time it was around 120s.
Google Pixel 6 、 Android 12
Expected behavior
Able to quickly locate the success
Reproduction steps
Code:
Future
if (!hasPermission) {
return;
}
print('start');
var t1 = DateTime.now().millisecondsSinceEpoch;
final position = await geolocatorAndroid.getCurrentPosition(
locationSettings:
const LocationSettings(accuracy: LocationAccuracy.medium));
print(
'end position:$position , time: ${DateTime.now().millisecondsSinceEpoch - t1}');
_updatePositionList(
_PositionItemType.position,
position.toString(),
);
}
print: end position:Latitude: xxx, Longitude: xxx , time: 120684
Configuration
flutter doctor: [✓] Flutter (Channel stable, 2.10.3, on macOS 11.4 20F71 darwin-arm, locale ) [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] VS Code (version 1.64.2) [✓] Connected device (2 available) [✓] HTTP Host Availability
Version: v8.2.0 v8.2.0 Platform:
- [x] :robot: Android
Hey @lgh001. Thanks for reporting your issue, I tried reproducing your issue but can't manage to do so. I'm also using a Google Pixel 6 with Android 12. Does the same issue occur when using the Geolocator example app?
Closing this issue as there was no response for over a year.