简体   繁体   中英

Geocoder getFromLocation failed

I'm trying to get placemarks from coordinates.

I'm using geoLocator for that. It was working fine today morning, but now, it throws platform exception.

PlatformException(IO_ERROR, A network error occurred trying to lookup the supplied coordinates (latitude: <lat>, longitude: <long>)., null)

It says it's a.network error, but my device is connected to the inte.net,

First, i thought there might be some problem in the Geolocator package, so i used Geocoding package, but the problem persists.

This is the error from geocoder.

Geocoder getFromLocation --- mService = android.location.ILocationManager$Stub$Proxy@e8c2197, ex = grpc failed, return results = []

Please help.

See this flutter_geocoding issue (closed): https://github.com/Baseflow/flutter-geocoding/issues/23

Two solutions presented:

  1. create a new emulator
  2. stop WiFi on the emulator, restart WiFi and let it find the network (AndroidWiFi)

Solution 2 worked for me.

I had the same problem. Try another emulator (create another emulator as if you are using another android or ios device). May be the current device that is being emulated is having problems connecting to the internet

try to add localeIdentifier parameter. works for me. my function code will be like

List<Placemark> newPlace = await GeocodingPlatform.instance.placemarkFromCoordinates(position.latitude, position.longitude,localeIdentifier: "en");

Try to WIPE DATA on your emulator. Restart it.

It works.

这主要是由于您的设备位置发生了变化,如果您使用的是安卓手机等外部设备,那么您应该重新启动您的设备,它就会工作。

I've faced the same issue.
Reason - The inte.net was not working inside my emulator.
Answer - If inte.net is not working inside your emulator, cold wipe your emulator from the virtual device manager and check again.

It solved my issue.

不知道是什么问题,但我最终制作了一个新的 android 模拟器(一个新的模拟设备),它运行良好。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM