Lyokone / flutterlocation

A Flutter plugin to easily handle realtime location in iOS and Android. Provides settings for optimizing performance or battery.
MIT License
1.11k stars 815 forks source link

[Dead Lock] getLocation() never return on iOS 17.4 simulator #955

Open EArminjon opened 4 months ago

EArminjon commented 4 months ago

Describe the bug getLocation() never return on iOS 17.4, major issue.

Expected behavior getLocation() should return or throw.

Tested on:

Additional logs No logs

EArminjon commented 4 months ago

I found a potential solution: be sure to select something valid here to avoid the issue :

Capture d’écran 2024-05-14 à 10 32 50

This must be added i believe in package documentation .

vaibhav891 commented 4 months ago

This does not seem to be working when selecting Custom Location... in the Location sub-menu above.

EArminjon commented 4 months ago

Yes for me too, I selected another option and then it worked.

magnatronus commented 3 months ago

Is there an answer to the original question regarding custom location?

Yes it does work if selecting a location that updates in the simulator which is fine (if in the US), but if you want to test that something works when at a specific location (use case here are places in Europe) this error still occurs and a customer location 'deadlocks' returning neither error or location.

ldcpereira commented 3 months ago

Hi,

As a workaround, I've done like this:

LocationData locationData = await Future.any([
          location.getLocation(),
          Future.delayed(
              const Duration(seconds: 3),
              () => LocationData.fromMap({
                    "latitude": position.latitude,
                    "longitude": position.longitude
                  }))
        ]);
mbalmer commented 1 month ago

I am hit by the same issue, iOS simulator does not return any data when the location is set to custom location. Also with iOS 17.5.

sjordan2010 commented 2 weeks ago

I have exact same bug with iOS 17.0 simulator.

SteveCMAC commented 4 days ago

Looks like this is maybe an issue with the iOS simulator.

Just tested with iOS 18 and the same thing happens, if you set a custom location it seems to hang, but if you select Apple as the location that it will work as intended, so maybe an issue just with custom location in the sim ?