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

Unhandled Exception: BleError (Error code: 2, ATT error code: null, iOS error code: null) #609

Open
sivaperumal644 opened this issue Sep 2, 2021 · 5 comments

Comments

@sivaperumal644
Copy link

While trying to connect device it throws the below error sometimes and not always. I couldn't identify what causes this.

[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: BleError (Error code: 2, ATT error code: null, iOS error code: null, Android error code: null, reason: null, internal message: null, device ID: null, service UUID: null, characteristic UUID: null, descriptor UUID: null)

The error code does not remain the same it changes to 2, 205, 204 and many but couldn't handle this error.

I tried connect(requestMtu: 250).catchError((){print("some error")}) and connect(requestMtu: 250).onError((error, stacktrace) {print("error");});. But it didn't go into catch or the error block.

Couldn't identify what is causing this exception to occur at the first place, and also don't how to handle this exception.

@ride4sun
Copy link

Get the same error - I think it is known by the package owner but he is not fixing it. I am wondering if someone branched the package and fixed all the issues because otherwise, this package is solid.

@skashok
Copy link

skashok commented Jun 3, 2022

Hi @sivaperumal644 @ride4sun

Did you all manage to get workaround for this issue. I am too still getting this error.

@freedreamer82
Copy link

same here...please find a workaround fix :(

@MoralCode
Copy link

MoralCode commented Jun 10, 2022

there was some discussion of alternatives in #613.
I also think i found a list of what the codes mean:

class BleErrorCode {

TL;DR:
2 -> operationCancelled
204 -> deviceNotFound
205 -> deviceNotConnected

that might help solve your more immediate issue, and judging by this it seems like this particular issue may just be a case of "the error is not great at explaining what went wrong to humans" rather than "something is broken in the library that isnt fixed yet"

@sivaperumal644
Copy link
Author

sivaperumal644 commented Jun 11, 2022

Hi @sivaperumal644 @ride4sun

Did you all manage to get workaround for this issue. I am too still getting this error.

@skashok I couldn't find a solution and I had few more deprecated issues in both android and iOS with this plugin, So I decided to use a different plugin. I used flutter_blue_plugin.

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

5 participants