flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

PlatformException (PlatformException(ERROR_GEOCODING_COORDINATES, Service not Available, null))

Open bijoya-banik opened this issue 7 years ago • 8 comments

💬 Questions and Help

For questions or help we recommend checking:

  • The Flutter tag in Stack Overflow Capture I want to convert latitude and longitude to formatted address. But don't know why it shows me this error now.

bijoya-banik avatar Sep 03 '19 05:09 bijoya-banik

Same:( Any solution?

rakhimian avatar Sep 16 '19 06:09 rakhimian

same here...

pr0thean avatar Sep 24 '19 10:09 pr0thean

Hello @bijoya-banik, @RakhimyanTim, @pr0thean. I have tested this with our company's address and it gave me the correct response. I used this:

List<Placemark> placemark = await Geolocator().placemarkFromCoordinates(52.221539, 6.893662); image

Please make sure to see if the Latitude and Longitude are properly filled in and that you have given the app permission to use the GPS.

ChiefMax avatar Sep 25 '19 11:09 ChiefMax

@bijoya-banik, @RakhimyanTim, @pr0thean, the "Service not Available" error indicates that an IOException occurred when executing the native call (see Android docs).

Usually this means you don't have internet which is required to translate the longitude / latitude into a physical address.

mvanbeusekom avatar Oct 02 '19 09:10 mvanbeusekom

@mvanbeusekom, this issue doesn't reproduce on the emulator, but it's still there on my Android device in the debug mode, and I have good internet connection. Please, help with this...

Apollo108 avatar Aug 03 '20 16:08 Apollo108

Hello @Apollo108, it is very well possible that the device doesn't have Play Services installed or enabled (maybe blocked by goverment firewalls). The geocoding feature relies on the native Android implementation which means it needs Play Services to be available.

mvanbeusekom avatar Aug 03 '20 17:08 mvanbeusekom

@mvanbeusekom image checked with https://pub.dev/packages/google_api_availability plugin, seems Play Services are OK, and the issue is still here... What am I doing wrong? Reproduced on Xiaomi MI 9 SE and Meizu M3 note, issue didn't reproduce on Google Pixel 3a... And Google Place is working at the same time, so I can get place info by the placeId.

UPDATE: I cleaned both cache and data for Google Play Services and Play Store and rebooted - it helped, but I don't know why and for how long, and what was the cause of the problem...

Apollo108 avatar Aug 03 '20 17:08 Apollo108

@Apollo108 as mentioned earlier, the "Service not Available" indicates that an IOException occurred during the translation of the coordinates. According to the underlying Android SDK we are using this means "IOException is thrown if the network is unavailable or any other I/O problem occurs".

This is not really something I can help you fix. More information are in the Android docs.

mvanbeusekom avatar Aug 04 '20 10:08 mvanbeusekom