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.

Denny Weinberg
  • 2,492
  • 1
  • 21
  • 34
  • Possible duplicate of [Why is Android Geocoder throwing a "Service not Available" exception?](https://stackoverflow.com/questions/4761052/why-is-android-geocoder-throwing-a-service-not-available-exception) – xomena Jun 01 '18 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... – Denny Weinberg Jun 01 '18 at 20:57
  • As the following answer suggest that RESTART YOUR PHONE will fix the problem. Check out this [link](https://issuetracker.google.com/issues/36956130) – meyasir Jul 07 '18 at 07:49
  • doesn't work for me – Denny Weinberg Jul 12 '18 at 20:25

2 Answers2

1

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

Denny Weinberg
  • 2,492
  • 1
  • 21
  • 34
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

ppqq
  • 28
  • 7
  • 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... – Denny Weinberg Jun 01 '18 at 20:46
  • I am not sure but if i good remember i wrote it in Manifest as metadata something like that app\src\main\res\values also here had file i just checked – ppqq Jun 01 '18 at 20:53
  • Thats what I've done. This works for my Google Maps Fragment, but not for my Geocoder... – Denny Weinberg Jun 01 '18 at 20:54
  • is that so meybe your key just expired orbugged it's posible your app work becouse app wasn't uninstalled – ppqq Jun 01 '18 at 20:56
  • I reinstalled the app and the map still works. Strange... But not the geocoder... I think I will try with a temporary new key... – Denny Weinberg Jun 01 '18 at 21:00
  • try also turn on and off phone when i wrote my enginery work i spend alot of time to figure it out – ppqq Jun 01 '18 at 21:05
  • Yeah, I did this at least 10 times until I have the problem :p – Denny Weinberg Jun 01 '18 at 21:10