You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user reported this crash on an Android 5.0 (API 21) device:
Fatal Exception: java.lang.NoSuchMethodError: No virtual method putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Ljava/util/HashMap; or its super classes (declaration of 'java.util.HashMap' appears in /system/framework/core-libart.jar)
at com.androidcommunications.polar.api.ble.model.gatt.BleGattBase.addCharacteristic(BleGattBase.java:306)
at com.androidcommunications.polar.api.ble.model.gatt.BleGattBase.addCharacteristicNotification(BleGattBase.java:280)
at com.androidcommunications.polar.api.ble.model.gatt.client.psftp.BlePsFtpClient.<init>(BlePsFtpClient.java:64)
at com.androidcommunications.polar.api.ble.model.gatt.BleGattFactory.getRemoteServices(BleGattFactory.java:41)
at com.androidcommunications.polar.enpoints.ble.bluedroid.host.BDDeviceSessionImpl.<init>(BDDeviceSessionImpl.java:80)
at com.androidcommunications.polar.enpoints.ble.bluedroid.host.BDDeviceListenerImpl.deviceDiscovered(BDDeviceListenerImpl.java:301)
at com.androidcommunications.polar.enpoints.ble.bluedroid.host.BDScanCallback.onScanResult(BDScanCallback.java:273)
at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run(BluetoothLeScanner.java:337)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5537)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:956)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:751)
It turns out that calling HashMap.putIfAbsent() requires minSdkVersion>=24, at least according to the warning shown by Android Studio when I try to use that in my code.
In your 'Getting Started' instructions, you set minSdkVersion=21. So I believe it would make sense to either change this to 24, or to stop using putIfAbsent() - it's quite trivial to use containsKey()+put() instead.
Thanks!
How to Reproduce
Try to detect Polar devices on an Android device with Android 5.0, 5.1 or 6.0.
Expected behavior
No crash.
The text was updated successfully, but these errors were encountered:
Platform on which you observed the bug:
Device on which you observed the bug:
Describe the bug
A user reported this crash on an Android 5.0 (API 21) device:
It turns out that calling HashMap.putIfAbsent() requires minSdkVersion>=24, at least according to the warning shown by Android Studio when I try to use that in my code.
In your 'Getting Started' instructions, you set minSdkVersion=21. So I believe it would make sense to either change this to 24, or to stop using putIfAbsent() - it's quite trivial to use containsKey()+put() instead.
Thanks!
How to Reproduce
Try to detect Polar devices on an Android device with Android 5.0, 5.1 or 6.0.
Expected behavior
No crash.
The text was updated successfully, but these errors were encountered: