Skip to content
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

This cannot be run on UI thread, starting BLE scan can be expensive #92

Open
bsorrentino opened this issue Aug 25, 2015 · 1 comment
Open

Comments

@bsorrentino
Copy link

Hi i've ran a Cordova App using this plugin on a device with Android 5.0.2 and got the error below

I've seen that on Estimote/Android-SDK such issue seems resolved but how can I solve it using the phonegap plugin ?

08-25 23:14:25.441    9187-9187/org.bsc.beacon E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: org.bsc.beacon, PID: 9187
    java.lang.IllegalArgumentException: This cannot be run on UI thread, starting BLE scan can be expensive
            at com.estimote.sdk.internal.Preconditions.checkArgument(Preconditions.java:65)
            at com.estimote.sdk.service.BeaconService.checkNotOnUiThread(BeaconService.java:529)
            at com.estimote.sdk.service.BeaconService.access$600(BeaconService.java:62)
            at com.estimote.sdk.service.BeaconService$InternalLeScanCallback.onLeScan(BeaconService.java:517)
            at android.bluetooth.BluetoothAdapter$2.onScanResult(BluetoothAdapter.java:1720)
            at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run(BluetoothLeScanner.java:330)
            at android.os.Handler.handleCallback(Handler.java:739)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5312)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
@digiclick74
Copy link

I have the same problem on an Asus Zenfone 2 with Lollipop 5.0 version.
Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants