GRPC failed to use geocoder

I am using android studio.

I am trying to get location name from googlemaps when clicked.

I am using a geocoder.

Every time I click somewhere on the map, the marker goes there, but I can’t get the name of the city, and I get an error with grpc error.

What should I do? I tried this with api 23,24,25 , none of them worked.

My onMapClick function:

@Override public void onMapClick(LatLng latLng) { mMap.clear(); mMap.addMarker(new MarkerOptions().position(latLng).title("Konum")); mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); Geocoder geocoder = new Geocoder(MapsActivity.this.getBaseContext(), Locale.getDefault()); try { List<Address> city = geocoder.getFromLocation(latLng.latitude,latLng.longitude,1); if (city != null && city.size() > 0){ Log.i("Info",city.get(0).getLocality()); } } catch (IOException e) { e.printStackTrace(); } } 

W / System.err: java.io.IOException: grpc error W / System.err: at com.example.umut.googlemapstest.MapsActivity $ override.onMapClick (MapsActivity.java:127)

What shows

 List<Address> city = geocoder.getFromLocation(latLng.latitude,latLng.longitude,1); 

This code

+7
java android google-maps
source share

No one has answered this question yet.

See related questions:

907
Failed to load the JNI shared library (JDK)
880
"Conversion to Dalvik format failed with error 1" on an external JAR
687
Android error: Failed to install * .apk on device *: timeout
10
Geocoder grpc error
one
Unexpected grpc failed to use geocoder
0
How do I search for cities on Google Maps?
0
hide the INFO window indicator and show it dynamically
0
How to find the longitude and latitude of a specific location?
-2
How to add polylines with an array of positions?

All Articles