-
Notifications
You must be signed in to change notification settings - Fork 83
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
Multiple ProfileServiceNotBound errors when trying to write to a Peripheral #714
Comments
Can you provide a breakdown of the failure rate per Android version? |
Thanks for the info. We're seeing this in our apps as well. I'll try to allocate some time soon to investigate. |
@PavlosTze I'm currently investigating this issue. Do you happen to know what version of Kable you first saw this issue in? |
@twyatt It started with 0.31.1. |
Thanks, I believe I've tracked down the cause: I believe it was introduced in #648, when a bug was fixed (whereas Kable would silently ignore failures to write to a characteristic). In #648, that behavior was fixed (to now throw an exception if the write failed). Unfortunately, some might be relying on the bug (that was fixed) where it didn't propagate a failure when the write fails. I'm trying to determine what the best API/behavior might be for this situation. I'll follow up soon. |
Sure, I just want to mention that this is a non-crash failure. Which means that if it failed before in the same way, the only thing happening now is that it's been showing up in the logs, not that big of a deal. I'm wondering if we can solve it in the background based on what it says here?
Is it possible to bind a profile service if we get across this failure? |
I suspect that the code comment you referenced is misleading in this case. I believe the failure happens when a write occurs after a connection is lost / disposed; because the connection was disposed, the underlying Android GATT object no longer has a "profile service" (essentially a reference to the underlying Android BLE system) and so propagates that failure. I believe it is unrelated to I think in most cases it is safe to ignore the failure (in the cases where it happens because the connection was recently disposed). The case where it might be problematic is where The reason it is important for Kable to propagate the failure though, is the consumer should be aware that the requested |
The connection management, especially around I/O has been refactored. Can you try 0.35.0-rc and see if the issue has been resolved? |
Hey, unfortunately I couldn't reproduce the error, but there are numerous crashlytics logs from our users. But...As I saw the changes of |
That sounds great. I appreciate you taking the time to help test. ❤️ |
Hey, I tested it thoroughly today, I opened some issues. FYI our project is open-source, in case you want to have a look at how we use Kable, you can view our Feel free to ask me if anything, happy to help. |
Thanks for reporting all those issues! Super helpful! |
Hello,
I have the following code:
And for some weeks already this code is producing a lot of
ProfileServiceNotBound
types of exception, the log is the following:As you can see from these 3 screenshots issues started in early June:
In case that helps, our app producing those is Open Source.
Based on what I read in your writeResultFrom and in the Android-related code:
Any chance you can catch this error without letting it fail? What is this related to? As there aren't any logs producing it in the past and we've been using Kable for around 2 years already.
The text was updated successfully, but these errors were encountered: