Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request connection error #1108

Closed
yerzhant opened this issue Jun 28, 2024 · 2 comments
Closed

Request connection error #1108

yerzhant opened this issue Jun 28, 2024 · 2 comments

Comments

@yerzhant
Copy link

yerzhant commented Jun 28, 2024

With this code:

    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)
@navaronbracke
Copy link
Collaborator

This has nothing to do with mobile_scanner?

@yerzhant
Copy link
Author

Sorry, it meant to be opened in google/nearby.
google/nearby#2666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants