getFromLocationName error, Service not available.

2020-07-09 07:25发布

问题:

In my app I am using the getFromLocationName, and it has been working in the app until recently, now all of a sudden I am getting is "Service not available".

The exception says: Geocoder.getFromLocationName(Geocoder.java:178)

This is the code I am using:

 Geocoder coder = new Geocoder(this);
 List<Address> address = null;
 try {
    address = coder.getFromLocationName(navAddr,5);
 } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
 }

To be honest I do not know if has stopped working after I have switched to release build.

I hope someone can point me to what I can do to fix this.

回答1:

I have the excact same problem. I have two apps there has been working perfectly for a while, but stopped working today. What is weird is that in three phones it's not working (2.2, 4.0 and 4.1) but in android 2.1 there's no problem.

There seems to be a problem with the Google Maps Geocoder service, and not our use of the service.

Edit: I just found out that you just have to restart your phone.