ReactiveBeacons
ReactiveBeacons copied to clipboard
IllegalStateException in LollipopScanStrategy
java.lang.IllegalStateException: BT Adapter is not turned ON at android.bluetooth.le.BluetoothLeUtils.checkAdapterStateOn(BluetoothLeUtils.java:136) at android.bluetooth.le.BluetoothLeScanner.stopScan(BluetoothLeScanner.java:206) at com.github.pwittchen.reactivebeacons.library.scan.strategy.lollipop.LollipopScanStrategy$1.call(LollipopScanStrategy.java:43) at rx.subscriptions.BooleanSubscription.unsubscribe(BooleanSubscription.java:71) at rx.internal.util.SubscriptionList.unsubscribeFromAll(SubscriptionList.java:136) at rx.internal.util.SubscriptionList.unsubscribe(SubscriptionList.java:125) at rx.Subscriber.unsubscribe(Subscriber.java:98) at rx.internal.util.SubscriptionList.unsubscribeFromAll(SubscriptionList.java:136) at rx.internal.util.SubscriptionList.unsubscribe(SubscriptionList.java:125) at rx.Subscriber.unsubscribe(Subscriber.java:98) at com.sminq.user.services.BleBeaconService.onDestroy(BleBeaconService.java:219) at android.app.ActivityThread.handleStopService(ActivityThread.java:3327) at android.app.ActivityThread.-wrap27(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1570) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Hi,
Thanks for reporting this issue.
It looks like Bluetooth is turned off. Please, take a look at the Good Practices section in README.md
file. You should fulfill requirements mentioned in this section:
- update Manifest
- check BLE support
- request Bluetooth access
- request Location access for API 23 and higher
- request runtime permissions for API 23 and higher
Take a look at the exemplary code snippet and examplary app.
Regards, Piotr