NoSuchElementException (cannot find the service) right after State.Connected #1085
Unanswered
curioustechizen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I think this might be a race condition in my app. My question is:
What does it mean if
characteristicOf()throwsNoSuchElementExceptioncomplaining that the service cannot be found, right after I connect to a peripheral?My intuition is that this should not happen because
State.Connectedimplies service discovery was successful. So my service must be available. However sometimes in the wild we see this error on both Android and iOS. When this happens we see several crashes within a span of a few minutes. This indicates that the user tried to connect to the peripheral several times in a row and hit the same exception every time.I'm trying to understand what could cause this. It could be a race condition on our end - my claim that
characteristicOfis only called after the state is Connected might be wrong. But are there any other situations where characteristicOf could not be able to find a service?Beta Was this translation helpful? Give feedback.
All reactions