Estimote / Android-Fleet-Management-SDK

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

Problem with Android 5 (Nexus 6) #92

Closed MikeGWem closed 9 years ago

MikeGWem commented 9 years ago

I have an app using Estimote beacons that runs happily on Android 4 devices (Nexus 7 and a rooted Nexus 10) using the Dalvik runtime. Testng on a Nexus 6 (Android 5 and Art runtime) the app crashes on executing the following line

beaconManager.startRanging(ALL_ESTIMOTE_BEACONS_REGION);

The log shows:

java.lang.IllegalArgumentException: This cannot be run on UI thread, starting BLE scan can be expensive
12-09 14:05:46.768: E/AndroidRuntime(1363):     at   com.estimote.sdk.internal.Preconditions.checkArgument(Preconditions.java:65)
12-09 14:05:46.768: E/AndroidRuntime(1363):     at com.estimote.sdk.service.BeaconService.checkNotOnUiThread(BeaconService.java:502)
12-09 14:05:46.768: E/AndroidRuntime(1363):     at com.estimote.sdk.service.BeaconService.access$600(BeaconService.java:61)
12-09 14:05:46.768: E/AndroidRuntime(1363):     at com.estimote.sdk.service.BeaconService$InternalLeScanCallback.onLeScan(BeaconService.java:490)
12-09 14:05:46.768: E/AndroidRuntime(1363):     at android.bluetooth.BluetoothAdapter$2.onScanResult(BluetoothAdapter.java:1704)
12-09 14:05:46.768: E/AndroidRuntime(1363):     at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run
wiktor commented 9 years ago

Please update to the newest version of the library.

On Wed, Dec 10, 2014 at 1:50 PM, MikeGWem notifications@github.com wrote:

I have an app using Estimote beacons that runs happily on Android 4 devices (Nexus 7 and a rooted Nexus 10) using the Dalvik runtime. Testng on a Nexus 6 (Android 5 and Art runtime) the app crashes on executing the following line beaconManager.startRanging(ALL_ESTIMOTE_BEACONS_REGION); The log shows: java.lang.IllegalArgumentException: This cannot be run on UI thread, starting BLE scan can be expensive 12-09 14:05:46.768: E/AndroidRuntime(1363): at com.estimote.sdk.internal.Preconditions.checkArgument(Preconditions.java:65) 12-09 14:05:46.768: E/AndroidRuntime(1363): at com.estimote.sdk.service.BeaconService.checkNotOnUiThread(BeaconService.java:502) 12-09 14:05:46.768: E/AndroidRuntime(1363): at com.estimote.sdk.service.BeaconService.access$600(BeaconService.java:61) 12-09 14:05:46.768: E/AndroidRuntime(1363): at com.estimote.sdk.service.BeaconService$InternalLeScanCallback.onLeScan(BeaconService.java:490) 12-09 14:05:46.768: E/AndroidRuntime(1363): at android.bluetooth.BluetoothAdapter$2.onScanResult(BluetoothAdapter.java:1704)

12-09 14:05:46.768: E/AndroidRuntime(1363): at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run

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

MikeGWem commented 9 years ago

Thanks for that. I was under the misapprehension that I was running the latest version but I was not - now all working fine.

Sorry for raising the issue.

Regards,

mike

On Wed, Dec 10, 2014 at 12:51 PM, Wiktor Gworek notifications@github.com wrote:

Please update to the newest version of the library.

On Wed, Dec 10, 2014 at 1:50 PM, MikeGWem notifications@github.com wrote:

I have an app using Estimote beacons that runs happily on Android 4 devices (Nexus 7 and a rooted Nexus 10) using the Dalvik runtime. Testng on a Nexus 6 (Android 5 and Art runtime) the app crashes on executing the following line beaconManager.startRanging(ALL_ESTIMOTE_BEACONS_REGION); The log shows: java.lang.IllegalArgumentException: This cannot be run on UI thread, starting BLE scan can be expensive 12-09 14:05:46.768: E/AndroidRuntime(1363): at com.estimote.sdk.internal.Preconditions.checkArgument(Preconditions.java:65)

12-09 14:05:46.768: E/AndroidRuntime(1363): at com.estimote.sdk.service.BeaconService.checkNotOnUiThread(BeaconService.java:502)

12-09 14:05:46.768: E/AndroidRuntime(1363): at com.estimote.sdk.service.BeaconService.access$600(BeaconService.java:61) 12-09 14:05:46.768: E/AndroidRuntime(1363): at com.estimote.sdk.service.BeaconService$InternalLeScanCallback.onLeScan(BeaconService.java:490)

12-09 14:05:46.768: E/AndroidRuntime(1363): at android.bluetooth.BluetoothAdapter$2.onScanResult(BluetoothAdapter.java:1704)

12-09 14:05:46.768: E/AndroidRuntime(1363): at

android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run

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

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

mohdhise commented 9 years ago

where to get latest estimote-sdk-preview.jar for eclipse?

wiktor commented 9 years ago

We switched to aar (android archive) distribution. Please do follow new install instructions and update your gradle file.

On Wed, Apr 22, 2015 at 10:24 AM, mohdhise notifications@github.com wrote:

where to get latest estimote-sdk-preview.jar for eclipse?

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