flutterlocation
flutterlocation copied to clipboard
blocking when call getLocation()
Environment:
Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (2 weeks ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4
Location location = new Location();
bool _serviceEnabled;
PermissionStatus _permissionGranted;
LocationData _locationData;
_serviceEnabled = await location.serviceEnabled();
if (!_serviceEnabled) {
_serviceEnabled = await location.requestService();
if (!_serviceEnabled) {
return;
}
}
_permissionGranted = await location.hasPermission();
if (_permissionGranted == PermissionStatus.denied) {
_permissionGranted = await location.requestPermission();
if (_permissionGranted != PermissionStatus.granted) {
return;
}
}
_locationData = await location.getLocation(); // <-- here will block for ever
Device:
HuaWei Honor 10
EMUI: 10.0.0
Android: 4.14.116
Any updates on this issue?
Haven't seen any progress yet
I have the same problem :(
same problem on iOS
I've found a workaround for this: https://github.com/Lyokone/flutterlocation/issues/621#issuecomment-931597019
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Let's remove the inactive label, because only the maintainer is inactive.
By the way, I have switched to geolocator since last year and everything looks fine.
Isn't it because you're using a Huawei device?
I have a Xiaomi Device and the same issue.