Geocoder getFromLocation failed
Asked Answered
E

9

6

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 internet,

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.

Eveland answered 3/9, 2020 at 17:26 Comment(2)
did u solve this?Carvel
Did any of the answers answer your question?Equipment
D
8

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");
Daliadalila answered 5/9, 2020 at 4:23 Comment(0)
E
7

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.

Equipment answered 24/11, 2020 at 11:16 Comment(1)
thanks, the solution 2 worked for me alsoTangier
C
6

Try to WIPE DATA on your emulator. Restart it.

It works.

Chaker answered 24/11, 2020 at 11:9 Comment(0)
P
2

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

Peroneus answered 29/10, 2020 at 20:9 Comment(0)
N
2

its mainly due to change in location of your device if you're using a external device like an android phone then you should reboot your device and it'll work .

Nilson answered 8/6, 2021 at 16:31 Comment(0)
B
1

Here is the correct reason why this is happening, From Geocoding package

and also there is no fix for this at the moment, as far as I have understood the rate gets reset by itself, so just restarting your emulator or app should help you get it back working.

Byrd answered 20/12, 2023 at 10:19 Comment(0)
O
0

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

It solved my issue.

Ornithorhynchus answered 17/11, 2022 at 14:42 Comment(0)
S
0

try stop emulator then flutter clean in terminal, then debug again it will work. no need to remove the emulator

Spritsail answered 25/10, 2023 at 10:48 Comment(0)
D
-1

Not sure what is the problem, but I ended up making a new android emulator(a new emulated device) and it worked fine.

Doomsday answered 8/1, 2022 at 17:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.