com.google.android.gms.common.api.ApiException: 17: API: Nearby.CONNECTIONS_API is not available on this device

157 views Asked by At

For near by connection Im getting this issue on failed connecion

Can any one faced this issue, I'm using all latest google dependeeencies

com.google.android.gms.common.api.ApiException: 17: API: Nearby.CONNECTIONS_API is not available on this device. Connection failed with: ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null, message=null}

1

There are 1 answers

0
Joe199382 On

Your device must have google play service. You can use the following code to check the device if it has google play service.

private fun isGooglePlayServicesAvailable(): Boolean {
    val availability = GoogleApiAvailability.getInstance()
    val resultCode = availability.isGooglePlayServicesAvailable(this)
    if (resultCode != ConnectionResult.SUCCESS) {
        availability.getErrorDialog(this, resultCode, 0)?.show()
        return false
    }
    return true
}