PlatformException when calling Geocoder.local.findAddressesFromCoordinates

2,596

Use:

await Geocoder.google(your_API_Key).findAddressesFromCoordinates(coordinates);

Instead of:

await Geocoder.local.findAddressesFromCoordinates(coordinates);
Share:
2,596
Bijoya_Banik
Author by

Bijoya_Banik

Coding now :)

Updated on December 01, 2022

Comments

  • Bijoya_Banik
    Bijoya_Banik over 1 year

    How can I convert location latitude and longitude to a formated address? I'm trying with geocoder plugin but the line- await Geocoder.local.findAddressesfromCoordinates(coordinates) gives me an error with showing platform exception. I used this plugin more times and it worked nicely, but this time in all my projects it shows same error, please help to solve.

    var coordinates = new Coordinates(latitude, longitude);
    var addresses = 
    await Geocoder.local.findAddressesFromCoordinates(coordinates);
    var first = addresses.first;
    var myAddress = first.addressLine;
    

    ** When I want to convert coordinates find this error :
    Unhandled Exception: PlatformException(failed, Failed, null) show error Message**