Estimote / Android-Fleet-Management-SDK

Estimote Fleet Management SDK for Android
https://developer.estimote.com
MIT License
836 stars 451 forks source link

Beacon search exception on Sony phone #176

Closed chkchk closed 7 years ago

chkchk commented 8 years ago

Exception occurs when it runs on Sony F3316 device (Android 6.0)

10-27 17:35:50.356 28763-29567/ W/MessageQueue: Handler (com.estimote.sdk.BeaconManager$IncomingHandler) {a3f529d} sending message to a Handler on a dead thread
                                                            java.lang.IllegalStateException: Handler (com.estimote.sdk.BeaconManager$IncomingHandler) {a3f529d} sending message to a Handler on a dead thread
                                                                at android.os.MessageQueue.enqueueMessage(MessageQueue.java:555)
                                                                at android.os.Handler.enqueueMessage(Handler.java:707)
                                                                at android.os.Handler.sendMessageAtTime(Handler.java:609)
                                                                at android.os.Handler.sendMessageDelayed(Handler.java:579)
                                                                at android.os.Handler.sendMessage(Handler.java:516)
                                                                at android.os.Handler$MessengerImpl.send(Handler.java:797)
                                                                at android.os.Messenger.send(Messenger.java:57)
                                                                at com.estimote.sdk.service.BeaconService.invokeCallbacks(BeaconService.java:644)
                                                                at com.estimote.sdk.service.BeaconService.access$4800(BeaconService.java:91)
                                                                at com.estimote.sdk.service.BeaconService$6.onScanCycleCompleted(BeaconService.java:1042)
                                                                at com.estimote.sdk.service.BeaconService$3$2.run(BeaconService.java:412)
                                                                at android.os.Handler.handleCallback(Handler.java:815)
                                                                at android.os.Handler.dispatchMessage(Handler.java:104)
                                                                at android.os.Looper.loop(Looper.java:207)
                                                                at android.os.HandlerThread.run(HandlerThread.java:61)

I'm not sure if it happens on other Sony device but my application works well for Samsung Galaxy S6 (6.0.1) It happens everytime found a beacon device. I try to use SDK 0.12.0 and latest 0.13.0 but nothing changed.

Anyone faced this problem?

ducva commented 8 years ago

I got the same problem. do you have solve it yet?

pawelDylag commented 8 years ago

Hello @chkchk, @ducva

It looks like your BeaconManager object was deleted, but never disconnected from underlying service, which tries to send scan data to "dead" beacon manager. I want you to make sure that your BeaconManager object is not deleted without calling disconnect() method. If this won't help, we will proceed further.

Have a great day!

chkchk commented 8 years ago

@pawelDylag, I didn't call disconnect() method but I didn't delete BeaconManager, my demo application just called Connect then StartRanging, I don't know why but it runs perfect on my Samsung device but the Sony device didn't

pawelDylag commented 7 years ago

Hello @chkchk @ducva

Could you confirm that this is still happening in version 1.0.2?

Have a nice day!