Estimote / Android-Proximity-SDK

Estimote Proximity SDK for Android
https://developer.estimote.com
MIT License
83 stars 41 forks source link

App crashes in the `SecureEstimoteMonitor` #94

Open tharpa opened 5 years ago

tharpa commented 5 years ago

Prerequisites

Basic information

Estimote SDK version: 1.0.3

Android devices affected: [Paste here your Android device model/models that you are having problems with.]

Android OS version affected: Oreo 8.1.0

Beacon hardware version: G1.12

Description

The Android app crashes on the Oreo device. Please find the stacktrace attached.

Fatal Exception: io.reactivex.exceptions.UndeliverableException: java.lang.Exception: Bluetooth Low Energy scan failed with error code: 2
       at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
       at io.reactivex.internal.operators.observable.ObservableRefCount$RefCountObserver.onError(ObservableRefCount.java:198)
       at io.reactivex.internal.operators.observable.ObservablePublish$PublishObserver.onError(ObservablePublish.java:182)
       at io.reactivex.internal.observers.BasicFuseableObserver.onError(BasicFuseableObserver.java:100)
       at io.reactivex.internal.observers.BasicFuseableObserver.onError(BasicFuseableObserver.java:100)
       at io.reactivex.internal.operators.observable.ObservableRefCount$RefCountObserver.onError(ObservableRefCount.java:196)
       at io.reactivex.internal.operators.observable.ObservablePublish$PublishObserver.onError(ObservablePublish.java:182)
       at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.checkTerminate(ObservableFlatMap.java:506)
       at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.drainLoop(ObservableFlatMap.java:335)
       at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.drain(ObservableFlatMap.java:327)
       at io.reactivex.internal.operators.observable.ObservableFlatMap$InnerObserver.onError(ObservableFlatMap.java:582)
       at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.checkTerminate(ObservableFlatMap.java:506)
       at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.drainLoop(ObservableFlatMap.java:335)
       at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.drain(ObservableFlatMap.java:327)
       at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.onError(ObservableFlatMap.java:292)
       at io.reactivex.internal.observers.BasicFuseableObserver.onError(BasicFuseableObserver.java:100)
       at io.reactivex.internal.operators.observable.ObservableGroupBy$GroupByObserver.onError(ObservableGroupBy.java:137)
       at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.tryOnError(ObservableCreate.java:85)
       at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onError(ObservableCreate.java:73)
       at com.estimote.proximity_sdk.internals.monitoring.estimote_monitoring.secure.SecureEstimoteMonitor$startEstimoteSecureScan$1$2.invoke(SecureEstimoteMonitor.kt:54)
       at com.estimote.proximity_sdk.internals.monitoring.estimote_monitoring.secure.SecureEstimoteMonitor$startEstimoteSecureScan$1$2.invoke(SecureEstimoteMonitor.kt:21)
       at com.estimote.scanning_plugin.api.use_cases.ScanUseCase$notifyUserCallbacks$2.accept(ScanUseCase.kt:28)
       at com.estimote.scanning_plugin.api.use_cases.ScanUseCase$notifyUserCallbacks$2.accept(ScanUseCase.kt:8)
       at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77)
       at io.reactivex.internal.observers.BasicFuseableObserver.onError(BasicFuseableObserver.java:100)
       at io.reactivex.internal.observers.BasicFuseableObserver.onError(BasicFuseableObserver.java:100)
       at io.reactivex.internal.observers.BasicFuseableObserver.onError(BasicFuseableObserver.java:100)
       at io.reactivex.internal.observers.BasicFuseableObserver.onError(BasicFuseableObserver.java:100)
       at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.tryOnError(ObservableCreate.java:85)
       at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onError(ObservableCreate.java:73)
       at com.estimote.scanning_plugin.packet_provider.scanner.PostLollipopEstimoteScanner$scan$1$callback$1.onScanFailed(PostLollipopEstimoteScanner.kt:29)
       at android.bluetooth.le.BluetoothLeScanner$1.run(BluetoothLeScanner.java:547)
       at android.os.Handler.handleCallback(Handler.java:790)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6548)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)

Expected behavior: The app not to crash and the BLE scan to start

Actual behavior: No BLE scan, the app crashes

Additional information

These are the requested permissions from AndroidManifest.xml

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>