0

I've been developing and Android App that uses Google's geocoder to translate different latitudes and longitudes to human readable addresses but just a few minutes ago I've been getting an IOException with the following message "Timed out waiting for response from server". Is anyone else facing the same problem? I know that in January of this year, a similar issue occured with the geocoder API and was a Google's issue.

I haven't changed anything related to the use of the geocoder in the application for months now.

I use the geocoder as expected:

Geocoder geocoder = new Geocoder(this, Locale.getDefault()); List addresses = geocoder.getFromLocation(latitude, longitude, 1);

And I have the correct permissions in my manifest:

<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

Here's the full stacktrace that I get:

04-03 22:55:51.788 19955-19955/com.tek3.thanksfrog W/System.err: java.io.IOException: Timed out waiting for response from server
04-03 22:55:51.798 19955-19955/com.tek3.thanksfrog W/System.err:     at android.location.Geocoder.getFromLocation(Geocoder.java:136)
04-03 22:55:51.798 19955-19955/com.tek3.thanksfrog W/System.err:     at com.tek3.thanksfrong.AppController.getLocationInfoFromLatLng(AppController.java:687)
04-03 22:55:51.798 19955-19955/com.tek3.thanksfrog W/System.err:     at com.tek3.thanksfrong.fragments.NewSceneFragment.loadCurrentLocationAddress(NewSceneFragment.java:268)
04-03 22:55:51.808 19955-19955/com.tek3.thanksfrog W/System.err:     at com.tek3.thanksfrong.fragments.NewSceneFragment.onResume(NewSceneFragment.java:247)
04-03 22:55:51.808 19955-19955/com.tek3.thanksfrog W/System.err:     at android.support.v4.app.Fragment.performResume(Fragment.java:1832)
04-03 22:55:51.808 19955-19955/com.tek3.thanksfrog W/System.err:     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)
04-03 22:55:51.808 19955-19955/com.tek3.thanksfrog W/System.err:     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
04-03 22:55:51.818 19955-19955/com.tek3.thanksfrog W/System.err:     at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)
04-03 22:55:51.818 19955-19955/com.tek3.thanksfrog W/System.err:     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)
04-03 22:55:51.818 19955-19955/com.tek3.thanksfrog W/System.err:     at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:458)
04-03 22:55:51.818 19955-19955/com.tek3.thanksfrog W/System.err:     at android.os.Handler.handleCallback(Handler.java:725)
04-03 22:55:51.818 19955-19955/com.tek3.thanksfrog W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:92)
04-03 22:55:51.818 19955-19955/com.tek3.thanksfrog W/System.err:     at android.os.Looper.loop(Looper.java:176)
04-03 22:55:51.818 19955-19955/com.tek3.thanksfrog W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5317)
04-03 22:55:51.828 19955-19955/com.tek3.thanksfrog W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
04-03 22:55:51.828 19955-19955/com.tek3.thanksfrog W/System.err:     at java.lang.reflect.Method.invoke(Method.java:511)
04-03 22:55:51.828 19955-19955/com.tek3.thanksfrog W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
04-03 22:55:51.828 19955-19955/com.tek3.thanksfrog W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
04-03 22:55:51.828 19955-19955/com.tek3.thanksfrog W/System.err:     at dalvik.system.NativeStart.main(Native Method)
mgvaldes
  • 23
  • 1
  • 5
  • I've already seen other posts where it is mentioned that `Geocoder` isn't functioning properly, even though it did earlier (a few hours/days ago). I went to the public ticket - https://code.google.com/p/gmaps-api-issues/issues/detail?id=9153 - that was made when this happened last January, and it seems there are others who are experiencing this right now. You did mention you didn't modify anything in the code, right? – AL. Apr 04 '16 at 06:17
  • 1
    Correct! I didn't change anything. The issue seems to be fixed. It's working again as expected. – mgvaldes Apr 04 '16 at 17:12

1 Answers1

0

First of all, it depends on which version of Android you are working. For example in the API 23, you need to check the permission for having the right to use the location permission?

My second point is : do you check if your position (latitude and longitude) are not null. Because if you use a location manager sometimes the position is null, because the GPS is slower than the Network or because the network and the GPS is not available.

But I am not sure about my last point, but for using geocoder from Google don't you need to have an API key? Or maybe I just mixed everything

kevingiroux
  • 155
  • 1
  • 14
  • I'm using API 21. Also, I've already checked that both the latitude and longitude passed to the geocoder.getFromLocation() call are not null. – mgvaldes Apr 03 '16 at 20:44
  • And for the position? Do you check if this position is null? – kevingiroux Apr 03 '16 at 20:45
  • Do you use the emulator? I could be a problem. If yes can you try a real devices? – kevingiroux Apr 03 '16 at 20:52
  • It seems you are not the only one to have the problem : http://stackoverflow.com/questions/36390518/geocoder-suddenly-stopped-working – kevingiroux Apr 03 '16 at 20:55
  • Yesterday I tried with 3 different devices and I had the same error. The issue seems to be fixed now. It's working again as expected. – mgvaldes Apr 04 '16 at 17:12