Xamarin.Essentials Geocoding.PlacemarksAsync使用Xamarin.forms在iOS中引发错误
我正在使用Xamarin的Geocoding.GetPlacemarksAsync(lat,lon)方法。Essentials来获取地点标记。但当我试图从lat long中获取placemarks时,它在iOS模拟器中抛出以下错误。它可以在Android emulator和Android物理设备中找到 错误:Xamarin.Essentials Geocoding.PlacemarksAsync使用Xamarin.forms在iOS中引发错误,xamarin,xamarin.forms,xamarin.android,xamarin.ios,xamarin-studio,Xamarin,Xamarin.forms,Xamarin.android,Xamarin.ios,Xamarin Studio,我正在使用Xamarin的Geocoding.GetPlacemarksAsync(lat,lon)方法。Essentials来获取地点标记。但当我试图从lat long中获取placemarks时,它在iOS模拟器中抛出以下错误。它可以在Android emulator和Android物理设备中找到 错误: NSErrorException Error Domain=kCLErrorDomain code=2 "(null)" at Xamarin.Essentials.G
NSErrorException Error Domain=kCLErrorDomain code=2 "(null)" at Xamarin.Essentials.GeoCoding.PlatformGetPlacemarksAsync
我在info.plist中添加了位置权限。我的项目配置是:
Xamarin.forms:4.5.0.725
Xamarin.要点:1.6.1
XCode:12.2
模拟器:iPhone8+14.4
同样的代码在Android中也能正常工作。希望有解决办法你有吗
这可能是网络或地理编码请求的频率问题,您最好检查一下
作为
KCLError 2是KCLError网络,描述为“网络不可用或发生网络错误”
及
CLGeocoder将限制地理编码请求,如果超过请求速率,将返回相同的错误
有关详细信息,请参阅和第页
如果仍然不起作用,你可以在真正的设备上尝试