ReactiveBeacons
ReactiveBeacons copied to clipboard
NullPointerException in LollipopScanStrategy
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.bluetooth.le.BluetoothLeScanner.startScan(android.bluetooth.le.ScanCallback)' on a null object reference at com.github.pwittchen.reactivebeacons.library.scan.strategy.lollipop.LollipopScanStrategy.observe(LollipopScanStrategy.java:36) at com.github.pwittchen.reactivebeacons.library.ReactiveBeacons.observe(ReactiveBeacons.java:143) at com.github.pwittchen.reactivebeacons.library.ReactiveBeacons.observe(ReactiveBeacons.java:120) at com.sminq.user.services.BleBeaconService$1.run(BleBeaconService.java:180) 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.app.ActivityThread.main(ActivityThread.java:5769) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
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