0

after removing firebase analytics, ads and crashlytics (and google-services.json), I get the following error:

java.io.IOException: Service not Available

Code:

Geocoder gcd = new Geocoder(context, Locale.getDefault());
final List<Address> addresses = gcd.getFromLocation(latlng.latitude, latlng.longitude, 1);

I don't find any explanation why this happens... Anyone here who can help me? There is no APIKey to appy or something, right?

PS: My maps fragment is working (com.google.android.geo.API_KEY meta-data in manifest is used)

I'm running OnePlus One, Android 8.1.0 (aosp_bacon-8.1.0-20180331.agentfabulous) and gapps mini.

4
  • Possible duplicate of Why is Android Geocoder throwing a "Service not Available" exception? Commented Jun 1, 2018 at 20:50
  • Oh, I recently reinstalled my Phone and thats maybe the problem... Uuuuh. I should test it with another phone (That I don't have :( ). However, I have Google Play and all this stuff installed, of course... Commented Jun 1, 2018 at 20:57
  • As the following answer suggest that RESTART YOUR PHONE will fix the problem. Check out this link Commented Jul 7, 2018 at 7:49
  • doesn't work for me Commented Jul 12, 2018 at 20:25

2 Answers 2

1

Seems to be a problem with my phone. I will implement this. I'm going to close this thread.

Sign up to request clarification or add additional context in comments.

Comments

0

Yes u need geocoding api key: When i used have same problem my solution was restart phone but from reserch then i found couple solution about that. Recreate api key Api key get limit or bugeed Use other for check is it blame of full service or not Move one part to other project and check does it work if yes that meen it's problem in code somew here

7 Comments

But where to put the API Key? Since I deleted the google-services.json. And I don't want to re-create this file, because I deleted the firebase project...
I am not sure but if i good remember i wrote it in Manifest as metadata something like that <meta-data android:name="com.google.android.geo.API_KEY" android:value="key" /> app\src\main\res\values also here had file i just checked
Thats what I've done. This works for my Google Maps Fragment, but not for my Geocoder...
is that so meybe your key just expired orbugged it's posible your app work becouse app wasn't uninstalled
I reinstalled the app and the map still works. Strange... But not the geocoder... I think I will try with a temporary new key...
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.