0

I'm using Geocoding.GetPlacemarksAsync(lat, lon) method of Xamarin.Essentials to get placemarks. But when I trying to get placemarks from lat long, It throws following error in iOS simulator. It works find in Android emulator and in android physical device too.

Error:

NSErrorException Error Domain=kCLErrorDomain code=2 "(null)" at Xamarin.Essentials.GeoCoding.PlatformGetPlacemarksAsync

I have added location permissions in info.plist. My project configurations are:

Xamarin.forms: 4.5.0.725

Xamarin.Essentials: 1.6.1

XCode: 12.2

Simulator: iPhone 8+ 14.4

Same code works fine in Android. Hope for solution

HarshShah
  • 23
  • 1
  • 9

1 Answers1

0

Do you have open and set the location in the simulator?

That's maybe a network or the frequency of geocoding requests problem, you'd better check it.

As

KCLError 2 is kCLErrorNetwork, described as "The network was unavailable or a network error occurred."

And

CLGeocoder will throttle geocoding requests, returning that same error if you exceed the request rate.

you can refer to this and this page for more details.

If that still not work, you can try it on the real device.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13