Estimote / Android-Fleet-Management-SDK

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

Android SDK 21 - crash when starting BlueTooh LE scan #85

Closed davidbilik closed 10 years ago

davidbilik commented 10 years ago

When you want to start ranging for beacons, this error occurs:

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:1703) 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:5221) 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:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

I dont know how to workaround now since this happens in your SDK.

wiktor commented 10 years ago

What OS/device?

davidbilik commented 10 years ago

Well, OS Android 5.0 Lollipop, newest preview and device Nexus 5.

wiktor commented 10 years ago

Oh, oh. I need to double check newest preview release.

On Fri, Oct 31, 2014 at 3:24 PM, billda007 notifications@github.com wrote:

Well, OS Android 5.0 Lollipop, newest preview and device Nexus 5.

Reply to this email directly or view it on GitHub: https://github.com/Estimote/Android-SDK/issues/85#issuecomment-61267245

lthlth91 commented 10 years ago

Hi Wiktor, I have the same problem. If you have a solution please let me know. Thanks!

wiktor commented 10 years ago

0.4.3 version fixes this issue. Can you verify?

lthlth91 commented 10 years ago

I'm not sure whether it's hardware problem or Android L's problem, the updated Estimote Official app can barely detect all the beacons synchronously.

wiktor commented 10 years ago

Agat so you mean by synchronously?

On Mon, Nov 17, 2014 at 4:53 PM, Tianhao notifications@github.com wrote:

I'm not sure whether it's hardware problem or Android L's problem, the updated Estimote Official app can barely detect all the beacons synchronously.

Reply to this email directly or view it on GitHub: https://github.com/Estimote/Android-SDK/issues/85#issuecomment-63325099

stevensanborn commented 10 years ago

I got the same thing "This cannot be run on UI thread, starting BLE scan can be expensive"

This is on the new lollipop nexus 5 (21)

BUT the latest release fixed it !!! thanks for this

lthlth91 commented 10 years ago

please download the updated sdk. The exception should be fixed, and also let me know how the new OS works with your beacon app. Thanks!

On Tue Nov 18 2014 at 5:04:47 PM Steven Sanborn notifications@github.com wrote:

I got the same thing "This cannot be run on UI thread, starting BLE scan can be expensive"

This is on the new lollipop nexus 5 (21)

— Reply to this email directly or view it on GitHub https://github.com/Estimote/Android-SDK/issues/85#issuecomment-63554075.

Harishy commented 10 years ago

Still App is not working app is crashing in Nexus5(lollipop OS).Giving the above exception.I tried with the latest estitmote sdk jar i.e., 0.4.3 version still getting the same issue.

wiktor commented 10 years ago

Which L version? What device?

Can you install Estimote app from Play Store and check if it works for you?

On Wed, Nov 19, 2014 at 2:48 PM, Harish notifications@github.com wrote:

Still App is not working app is crashing in Nexus5(lollipop OS).Giving the above exception.I tried with the latest estitmote sdk jar i.e., 0.4.3 version still getting the same issue.

Reply to this email directly or view it on GitHub: https://github.com/Estimote/Android-SDK/issues/85#issuecomment-63650264

davidbilik commented 10 years ago

Its working for me, I think you can close it.