Mad*_*ahi 5 android geolocation dart firebase flutter
我正在尝试从坐标中获取地标。
我正在用geoLocator这个。今天早上工作正常,但现在抛出平台异常。
PlatformException(IO_ERROR, A network error occurred trying to lookup the supplied coordinates (latitude: <lat>, longitude: <long>)., null)
Run Code Online (Sandbox Code Playgroud)
它说这是网络错误,但我的设备已连接到互联网,
首先,我认为包可能有问题Geolocator,所以我使用了Geocoding包,但问题仍然存在。
这是地理编码器的错误。
Geocoder getFromLocation --- mService = android.location.ILocationManager$Stub$Proxy@e8c2197, ex = grpc failed, return results = []
Run Code Online (Sandbox Code Playgroud)
请帮忙。
小智 8
尝试添加localeIdentifier参数。对我有用。我的功能代码将是这样的
List<Placemark> newPlace = await GeocodingPlatform.instance.placemarkFromCoordinates(position.latitude, position.longitude,localeIdentifier: "en");
Run Code Online (Sandbox Code Playgroud)
请参阅此 flutter_geocoding 问题(已关闭):https ://github.com/Baseflow/flutter-geocoding/issues/23
提出了两种解决方案:
解决方案 2 对我有用。
| 归档时间: |
|
| 查看次数: |
9303 次 |
| 最近记录: |