MKLocalSearch.start - https://developer.apple.com/documentation/mapkit/mklocalsearch/1452652-start is giving me MKErrorGEOError=-8 which is not documented in MKError - https://developer.apple.com/documentation/mapkit/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 Stack Overflow - https://stackoverflow.com/questions/66976777/mklocalsearch-start-returning-undocumented-mkerrorgeoerror too.