title: How can i get address from coordinates in android studio
body: <p>I have issues with reverse-geocoding. when I want to convert my coordinates to address, the Geocoder returns this error :</p>
  <blockquote>
  <p>Caused by: java.io.IOException: grpc failed</p>
  </blockquote>
  <p>this is my code :</p>
  <pre><code> val btnbymap = mycustomview.findViewById&lt;Button&gt;(R.id.edit_by_map)
  
  
              btnbymap.setOnClickListener {
  
                  if (ContextCompat.checkSelfPermission(
                          vl.context,
                          android.Manifest.permission.ACCESS_FINE_LOCATION
                      ) == PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(
                          vl.context,
                          android.Manifest.permission.ACCESS_COARSE_LOCATION
                      ) == PackageManager.PERMISSION_GRANTED
                  ) {
  
  
                      fusedLocationProviderClient.lastLocation.addOnSuccessListener(requireActivity()) {
  
  
                          location = it
  
                          val gcd = Geocoder(context, Locale.getDefault())
  
                          val addresses: List&lt;Address&gt; =
                              gcd.getFromLocationName(&quot;name&quot;, 1)
                          addresses[0].getAddressLine(0)
                          Toast.makeText(context, &quot;${addresses}&quot;, Toast.LENGTH_LONG).show()
  
  
                      }
  
                  } else {
                      requestPermissions(
                          arrayOf(
                              android.Manifest.permission.ACCESS_FINE_LOCATION,
                              android.Manifest.permission.ACCESS_COARSE_LOCATION
                          ), RequestCode
                      )
                  }
  
              }
          }
  </code></pre>
  <p>How can I fix this? Is there any alternative for geocode reverse?</p>