flutterlocation icon indicating copy to clipboard operation
flutterlocation copied to clipboard

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

Open EArminjon opened this issue 1 year ago • 8 comments

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

Expected behavior getLocation() should return or throw.

Tested on:

  • iOS, Version 17.4, iPhone 15 simulator

Additional logs No logs

EArminjon avatar May 14 '24 08:05 EArminjon

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 .

EArminjon avatar May 14 '24 08:05 EArminjon

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

vaibhav891 avatar May 15 '24 09:05 vaibhav891

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

EArminjon avatar May 15 '24 10:05 EArminjon

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.

magnatronus avatar Jun 13 '24 07:06 magnatronus

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
                  }))
        ]);

ldcpereira avatar Jun 14 '24 21:06 ldcpereira

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.

mbalmer avatar Aug 16 '24 07:08 mbalmer

I have exact same bug with iOS 17.0 simulator.

sjordan2010 avatar Sep 19 '24 15:09 sjordan2010

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 ?

SteveCMAC avatar Sep 29 '24 08:09 SteveCMAC