flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

Location time is too long

Open lgh001 opened this issue 3 years ago • 1 comments

🐛 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 _getCurrentPosition() async { final hasPermission = await _handlePermission();

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

lgh001 avatar Mar 15 '22 11:03 lgh001

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?

florissmit1 avatar Jul 01 '22 10:07 florissmit1

Closing this issue as there was no response for over a year.

JeroenWeener avatar Jul 11 '23 14:07 JeroenWeener