PlatformException (PlatformException(ERROR_GEOCODING_COORDINATES, Service not Available, null))
💬 Questions and Help
For questions or help we recommend checking:
- The Flutter tag in Stack Overflow
I want to convert latitude and longitude to formatted address. But don't know why it shows me this error now.
Same:( Any solution?
same here...
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);

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.
@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, 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...
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
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 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.