ios 12 location bug?

Good day!


On iOS 12 devices, I have strange situation, sometimes CLLocationManager returns location with bad latitude (usually zero) and proper longitude. And (as from user request to our API) it is very often situation.

I can't reproduce it in debug to submit a demo project or something like that.

We noticed such situation after public release of iOS 12, and have reports mostly from iOS 12 users.

Replies

hi it's been a 2 year since you asked ...

but i'm having exactly the same problem with some devices which is very rare, so i guess it's due to ios 12 but can't reproduce it.

so if you have can you share demo for me or the way to reproduce it?

thanks a lot for your help

This issue is still popping up. Has been appearing for my app for some users since June 2021. watchOS 7 & 8, iOS 14 & 15. Different sub-versions of each OS. No pattern I can detect. It's a problem for users sometimes, and not other times. The lat is zero, the lng is full of data and as best we can tell that data is correct. There is no chance that our code is modifying the location object or parsing its data incorrectly.

What's going on? Anyone from Apple have clues?

I'm also seeing this issue becoming increasingly common, especially with Complications. I'm working around it like so:

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
      if let location = manager.location as CLLocation? {
          if location.coordinate.latitude == 0 {
              return
          }

          locationManager.stopUpdatingLocation()

          // do stuff with location
      }
}

With the early return, didUpdateLocations might be called multiple times. In my testing, I always get a valid location after a few tries. I've been logging it, and usually didUpdateLocations only gets called twice, but I've seen it up to 5 times, all within the same second, before returning a valid location.

  • Hi, have you solved this issue?? We are also seeing this bug in iOS 16 (latitude 0 and proper longitude). Is the workaround code you attached working fine?? I'm considering using your idea, and i'm wondering how many times the update logic is being called in average to fetch proper lat&long together.

  • I've got the same problem when recursively (twice...) using the coordinates for two data elements that need them attached... if you temporise the process it works... seems like a low-importance bug that's low on priority for Apple sadly, still trying to figure out a workaround too.

Add a Comment

We are also constantly seeing this bug in our app in the wild in iOS versions up to 15.5, but haven't been able to reproduce it reliably.

Reported as https://feedbackassistant.apple.com/feedback/10875485.