Closed Macksly closed 2 years ago
Hi this crash is related to somebody turning off bluetooth. But I thought I fixed this already some time ago...
Which version of the library are you using?
I am using version 2.2.0
Ok, I just added a potential fix.
Can you try 2.2.1 which I just released?
I tested the new version and I cannot reproduce the crash in the app now. I'll make a hotfix for our app with this version of the library and monitor the analytics to see if the issue will surface again :)
Thanks a lot for your help!
Today I saw the same crash happening in our logs. It happened on a Android 10 device (if that might help).
Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.bluetooth.adapter.action.STATE_CHANGED flg=0x5000010 (has extras) } in com.welie.blessed.BluetoothCentralManager$12@8c53ce7 at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1575) at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(-.java:2) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7711) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.bluetooth.le.BluetoothLeScanner.stopScan(android.bluetooth.le.ScanCallback)' on a null object reference at com.welie.blessed.BluetoothCentralManager.handleAdapterState(BluetoothCentralManager.java:6) at com.welie.blessed.BluetoothCentralManager$12.onReceive(BluetoothCentralManager.java:6) at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1560) at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(-.java:2) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7711) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
but are you sure this user was using the updated library and not the old one?
Added another fix....release 2.2.2
but are you sure this user was using the updated library and not the old one?
I am sure that he is using the new version of the library, since he is using the new version of the app we released. I'd have to check with my team if we can release another hotfix soon. However I'll check if I can reproduce the crash and if the new version of the library will fix it 👍
I released a patch today, so fingers crossed :)
...let's see...
By the way, which phone was the crash happening on? And which version of Android. I never managed to reproduce this crash so I wonder which phone it was.
It was happening on a One Plus Nord running Android 10
I haven't noticed the issue anymore! Good job on fixing this :)
Hey,
We use your library in an production app and it works really good!! However I do see some crashes being logged in firebase from which I cannot pin point the origin. For context, we have about 2000 active users each day, however these crashes only occur for a few users once or twice.
Could you help me out?
` Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.bluetooth.adapter.action.STATE_CHANGED flg=0x5000010 (has extras) } in com.welie.blessed.BluetoothCentralManager$12@15f76bc at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1575) at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(-.java:2) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7711) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.bluetooth.le.BluetoothLeScanner.stopScan(android.bluetooth.le.ScanCallback)' on a null object reference at com.welie.blessed.BluetoothCentralManager.handleAdapterState(BluetoothCentralManager.java:6) at com.welie.blessed.BluetoothCentralManager$12.onReceive(BluetoothCentralManager.java:6) at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1560) at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(-.java:2) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7711) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) `