Lyokone/flutterlocation

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

EArminjon opened this issue · 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

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 .

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

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

Wow, took me 2 hours to find this. Thanks @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.

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