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
Exception on IOS #190
Comments
I have a similar issue - Using the stream for real time location updates and I ran into an issue. When my position is fixed in the simulator, the update works normally. Update the position from debug/location a couple of times and this error occurs [VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: PlatformException(ERROR_UPDATING_LOCATION, The operation couldn’t be completed. (kCLErrorDomain error 0.), null) Config iOS Simulator (12.1) and device (12.1.4) I am investigating this further, will update soon. |
Works correctly on iOS simulator 10.1, 11.1 Fails on 12.1 |
I'm having the same problem |
True. It happens even with the provided example. |
Hi, I am seeing the same issue, but for me I tried "city bicycle ride" first, and that worked! But then it failed when switching over to "city run" with this error. So City Bicycle Ride might be a profile you can use in the meantime. Edit 1: And now bicycle mode stopped working as well! |
I'm seeing this as well. I did this as a work around: StreamSubscription<Position> _positionStream;
void _streamLocation() {
// TODO: initialize _positionStream
_positionStream.onError((e) {
print("error streaming position: $e");
_disposePositionStream();
_streamLocation();
});
}
void _disposePositionStream() {
if (_positionStream != null) {
_positionStream.cancel();
_positionStream = null;
}
} Restarting the stream seems to make it work now. NOTE: This is not the optimal way to handle this with nulling the |
Still getting this error using the example app PlatformException(ERROR_UPDATING_LOCATION, The operation couldn’t be completed. (kCLErrorDomain error 0.), null) Config (Now) iOS Simulator (12.4) and device (10.x.x) |
By way of a Hack test.. LocationTask.m
This works reliably on the Simulator 12.4 and 10.3 Thoughts? |
Having the same problem after updating library to latest version. After some tests we found that exceptions kicked when WiFi is on, if enable 3g it works correcty. Any solutions for this? |
Having a similar problem. I'm trying to complete a course from londonappbrewery. I'm getting the following exceptions! Don't know how to fix it :/ As I press the button it shows: Launching lib/main.dart on iPhone Xʀ in debug mode... I've also tried to run it on the android simulator (Pixel 3a API 28). It worked but unfortunately, it's providing incorrect coordinates. The difference in coordinates is huge. Like, I'm trying to get a location from Pakistan and its showing location somewhere in the USA. |
#252 take a look at this and see if you have problems in common. Could you also provide me with some information about the course so I know what I'm looking at? |
Also seeing this for iOS devices in production on Sentry. I'm not using realtime location updates, just calls to
Ideas? |
The following code creates the same error for me:
VersionsAndroid Studio 3.5.3 geolocator-5.1.5 Running on similator: Iphone 11 Pro Max 13.3 As suggested by @softronaut setting the location in the simulator app will get rid of the error. So perhaps an improved error message would help. In my case the error was because no location was set. |
fixed it by following the iOS Simulator -> Features -> Location -> Custom Location... |
You have to set you custom location on the simulator under features>location>custom location |
Updated, this is now in Features -> Location -> Select an option |
Solved in version 6.0.0 |
@mvanbeusekom Obviously, this issue still appears when no location is set in the iPhone Simulator as others have pointed out. This is alright, but how to catch it properly? try {
permissionGranted = await location.requestPermission();
if (permissionGranted == LocationPlatformInterface.PermissionStatus.granted) {
currentPosition = await Geolocator.getCurrentPosition(
desiredAccuracy: desiredAccuracy ?? LocationAccuracy.best
); // crash, but no exception
} else {
currentPosition = null;
}
} catch (e) {
print(e);
currentPosition = null;
} This code will not catch the issue and it's hard to pin-point, as the message only appears in the Xcode logs. Also further execution will not work, see my referenced issue above. I wish it would just raise an exception so I could handle it properly. Also, do you know if this issue can occur on real devices if I check for permissions? I'm concerned. Thanks in advance. |
//Adding onError fixed it for me. |
🐛 Bug Report
I'm using the stream feature for real time location updates and I ran into an issue. When my position is fixed in the simulator, the update works normally but when I set the location to moving (simulator->debug->location->city run), an exception is thrown:
Expected behavior
The location updates without throwing an exception
Reproduction steps
Configuration
Version: 2.1.1
Platform:
The text was updated successfully, but these errors were encountered: