MKLocalSearch.start returning undocumented MKErrorGEOError

Viewed 211

MKLocalSearch.start is giving me MKErrorGEOError=-8 which is not documented in MKError.

  • This only happens in my CI machine!
  • This only happens when running the tests, the app code works fine
  • I tried enabling location services on macOS just in case, but it didn't work.
  • That machine shouldn't have any network requests/URLs blocked

What fixed for me was to add request.naturalLanguageQuery = "Venue", but I don't understand why, nor why this would fix an error that is happening in only 1 machine.

Does anyone have any information about this?


Here's some sample code:

let request = MKLocalSearch.Request()
request.naturalLanguageQuery = "Venue" // this fixes it, but why?!
let ibereCamargoMuseumCoordinates = CLLocationCoordinate2D(latitude: -30.0777596,
                                                           longitude: -51.2477212)
let span = MKCoordinateSpan(latitudeDelta: 5, longitudeDelta: 5)
request.region = MKCoordinateRegion(center: ibereCamargoMuseumCoordinates, span: span)
if #available(iOS 13.0, *) {
    request.resultTypes = .pointOfInterest
}

let localSearch = MKLocalSearch(request: request)
localSearch.start { response, error in
    ...
}

Here's some debugging output:

(lldb) po error
Error Domain=MKErrorDomain Code=4 "(null)" UserInfo={MKErrorGEOError=-8}

(lldb) po error.userInfo
▿ 1 element
  ▿ 0 : 2 elements
    ▿ key : AnyHashable("MKErrorGEOError")
      - value : "MKErrorGEOError"
    - value : -8

If you're interested I asked this on Apple dev forums too

0 Answers
Related