'PlatformException (PlatformException(ERROR_GEOCODING_COORDINATES, Service not Available, null))
How can I convert location latitude and longitude to a formatted address? I'm trying with geolocator plugin but the line- List placemark = await Geolocator().placemarkFromCoordinates(latitude, longitude); gives me an error with showing platform exception.Please help to solve and thanks in advance.
List<Placemark> placemark = await
Geolocator().placemarkFromCoordinates(latitude, longitude);
myAddress = placemark[0].name.toString();
print("Address: $myAddress");
Exception has occurred. PlatformException (PlatformException(ERROR_GEOCODING_COORDINATES, Service not Available, null)) error message
Solution 1:[1]
This error seems to be usually caused by network issues or Google Play Services not being present on the device, as mentioned on this GitHub issue thread. To solve the network issue, you can try using Google's Public DNS following this guide.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Omatt |