-
Notifications
You must be signed in to change notification settings - Fork 589
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
Crashing setUpNotification IllegalStateException #25
Comments
Hello there, I have a few questions:
Best Regards |
i sure
|
Finally I had some time to dig up your situation. I have checked Google for the As I don't see in the stacktrace any indication that the exception is being thrown anywhere in the library itself I suppose that there is some problem with too many things happening on the Android main thread. Have you checked what would happen if you replaced yours |
I'm getting the same problem. This is how i setup notifications.
My app has a set of devices and every 30 seconds, it connects to them, writes to a characteristic and subscribes to notifications. When a notification is received shortly after, the app disconnects from the device and waits another 30 seconds. This can go on for several minutes, but sooner or later i get the RejectedExecutionException.
Are you suggesting that I should try disconnecting straight after setting up notifications, and not executing anything else after the setup (this::notificationHasBeenSetUp, onNotificationReceived, onNotificationSetupFailure? |
I might have an idea what is the problem. in @Stjerndal Do you work with the sources or do you use maven to get the dependency? |
Maven, but could potentially try to use the source with that change within the next few days. |
Reviewers: michal.zielinski, pawel.urban Reviewed By: michal.zielinski, pawel.urban Differential Revision: https://phabricator.polidea.com/D1706
@Stjerndal @Reyurnible
|
Awesome, I will check it out! |
Please give a feedback here so we will know what's the status. |
Results are promising! The error has not occurred yet, and I've had the application running for a couple of hours as of now. This was however sometimes possible before the fix, where the app would occasionally be able to run an hour or two before crashing. I will keep it running during the day and report back. |
The issue seems to be resolved. I've been able to have it running for many hours without it occurring. Thanks, really appreciate it! I did however run into another problem. The app did not crash or throw exceptions after that many hours, but suddenly it was just unable to connect to the BLE devices at all, instantly giving the GATT status 133 when attempting. I tried to connect to the same BLE devices with another Android device, and was successful. Only after a reboot of the first Android device, it could connect to the BLE devices again. A restart of the bluetooth adapter did not suffice. I have not have the time to investigate this new issue properly, it might not even be RxAndroidBle that causes it. I just thought I'd mention it in case you have heard of something like this before. I will come back and maybe create a new Issue once I've studied the problem a bit more. PS. |
Glad to help. It will be officially available in 1.0.3 release. That's a known bug. In my opinion it's related to the wobbly Android BLE Stack - sometimes it happened to me if the gatt connections weren't disposed properly but it shouldn't be a problem now. If you will have any ideas - feel free to create an issue. If you encounter this situation next time you can try switching off BT and Wifi then switching them on as BT and Wifi stacks on Android are partially shared. Best Regards |
Summary
after connecting to a device then enabling the notifications #### Preconditions
BLE ON #### Steps to reproduce actual result 1. Connect device 2. Setup notification #### Actual result
Expected result
Crashing app.
The text was updated successfully, but these errors were encountered: