-
Notifications
You must be signed in to change notification settings - Fork 838
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
BeaconManager#unbind throws IllegalArgumentException #139
Comments
Thanks for the feedback, these are good suggestions. I imagine you can catch the exception in unbind for now, but I agree that this needs to be fixed. |
I run in the same problem. I use a custom Is there any fix for this right now? If not, do you have any suggestions on how to use BeaconConsumer in a custom class? Edit: |
just want to say Hi because I get an error to a different platform, although it is somewhat related. I'm using Flutter project, I created an issue to the guy created the package using altbeacons. then i get this error. Edit: kinda fixed the issue now by commenting |
@Ram231 Could you share your code snippet I am facing same issue in my flutter project. |
@darshithedpara . The project is dead(flutter beacons). I think you should find another alternatives like a flutter BLE. My project is now in graveyard and can't update the packages anymore. |
A few tips:
|
closed per #1046 |
Sometimes,
Beaconmanager#unbind
throws anIllegalArgumentException
:I'm calling
BeaconManager#bind
andBeaconManager#unbind
synchronously in a background thread. I wait forBeaconConsumer#onBeaconServiceConnect
or a timeout, then I wait forMonitorNotifier#didDetermineStateForRegion
or a timeout, I callBeaconManager#unbind
. Occasionally,BeaconManager#unbind
fails. Based on my review of your source. Two things could cause this:BeaconManager#bind
's call toBeaconConsumer#bindService
could fail.BeaconManager#bind
doesn't return this successboolean
to the caller, nor does it handle this failure in any way internally. If we later callBeaconManager#unbind
, the call will throw theIllegalArgumentException
described above.BeaconManager#beaconServiceConnection
could receive an#onServiceDisconnected
callback afterBeaconManager#bind
is called. SinceBeaconManager#beaconServiceConnection
is already unbound, when we later callBeaconManager#unbind
, the call will throw theIllegalArgumentException
described above.Please make
BeaconManager#bind
return a successboolean
, and add aonBeaconServiceDisconnect
method toBeaconConsumer
.Thanks!
The text was updated successfully, but these errors were encountered: