Android 连接低功耗蓝牙出现 Caught a RuntimeException from the binder stub implementation.

Caught a RuntimeException from the binder stub implementation.

正文

  最近在做低功耗蓝牙开发的时候突然遇到这样一个问题,出现这个情况的时候是我的一个App在Android12、和鸿蒙系统的手机上都正常的情况下,我用Android10去进行测试,然后出现这个问题,问题异常日志描述如下。

W/Binder: Caught a RuntimeException from the binder stub implementation.
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
        at android.os.Parcel.createException(Parcel.java:2088)
        at android.os.Parcel.readException(Parcel.java:2050)
        at android.os.Parcel.readException(Parcel.java:1998)
        at android.bluetooth.IBluetoothGatt$Stub$Proxy.clientConnect(IBluetoothGatt.java:2006)
        at android.bluetooth.BluetoothGatt$1.onClientRegistered(BluetoothGatt.java:199)
        at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:178)
        at android.os.Binder.execTransactInternal(Binder.java:1028)
        at android.os.Binder.execTransact(Binder.java:1001)

此时手机连接蓝牙,处于连接中,一直在连接中,新鲜出炉的Bug,得好好记录一下,并且说明一下解决过程。

我尝试过的方法:

  1. 重新安装应用,解决不了。
  2. 关闭开发者模式重新打开,解决不了。
  3. 关闭蓝牙重新打开,解决不了。
  4. 手机关机重启,解决了。

重启大法好,你值得拥有!

猜你喜欢

转载自blog.csdn.net/qq_38436214/article/details/125185042