You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
private val endpointDiscoveryCallback = object : EndpointDiscoveryCallback() {
override fun onEndpointFound(
endpoint: String,
discoveredEndpointInfo: DiscoveredEndpointInfo
) {
remoteEndpoint = endpoint
client.requestConnection(
"Receiver",
endpoint,
discovererConnectionCallback
)
.addOnSuccessListener { client.stopDiscovery() }
.addOnFailureListener { Log.e(logTag, "Failed to request a connection", it) }
}
override fun onEndpointLost(endpoint: String) {
Log.e(logTag, "Endpoint $endpoint lost")
}
}
override fun discover() {
val options = DiscoveryOptions.Builder().setStrategy(P2P_POINT_TO_POINT).build()
client.startDiscovery(serviceId, endpointDiscoveryCallback, options)
.addOnFailureListener { Log.e(logTag, "Discovery failed", it) }
}
First run is fine but the second and further ones return this error:
E/NearByService(31054): Failed to request a connection
E/NearByService(31054): com.google.android.gms.common.api.ApiException: 13: ERROR
E/NearByService(31054): at com.google.android.gms.internal.nearby.zzdo.setFailedResult(com.google.android.gms:play-services-nearby@@19.2.0:1)
E/NearByService(31054): at com.google.android.gms.internal.nearby.zzce.zzb(com.google.android.gms:play-services-nearby@@19.2.0:4)
E/NearByService(31054): at com.google.android.gms.internal.nearby.zzfr.zza(com.google.android.gms:play-services-nearby@@19.2.0:3)
E/NearByService(31054): at com.google.android.gms.internal.nearby.zzb.onTransact(com.google.android.gms:play-services-nearby@@19.2.0:3)
E/NearByService(31054): at android.os.Binder.execTransactInternal(Binder.java:1380)
E/NearByService(31054): at android.os.Binder.execTransact(Binder.java:1311)
The text was updated successfully, but these errors were encountered:
With this code:
First run is fine but the second and further ones return this error:
The text was updated successfully, but these errors were encountered: