wandersnail / easyble-x

A simple framework for Android Bluetooth Low Energy (BLE)
Apache License 2.0
156 stars 37 forks source link

运行在Android 5.1设备,连接蓝牙时报错 #12

Closed ghost closed 4 years ago

ghost commented 4 years ago

03-23 11:31:40.899 4907-4907/com.wandersnail.bledemo E/AndroidRuntime: FATAL EXCEPTION: main Process: com.wandersnail.bledemo, PID: 4907 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wandersnail.bledemo/com.wandersnail.bledemo.MainActivity}: java.lang.NullPointerException: Attempt to get length of null array at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2534) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2608) at android.app.ActivityThread.access$800(ActivityThread.java:178) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5637) 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:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) Caused by: java.lang.NullPointerException: Attempt to get length of null array at android.os.Parcel.readByteArray(Parcel.java:1772) at cn.wandersnail.ble.Device.(Device.java:188) at cn.wandersnail.ble.Device$1.createFromParcel(Device.java:199) at cn.wandersnail.ble.Device$1.createFromParcel(Device.java:196) at android.os.Parcel.readParcelable(Parcel.java:2252) at android.os.Parcel.readValue(Parcel.java:2152) at android.os.Parcel.readArrayMapInternal(Parcel.java:2485) at android.os.BaseBundle.unparcel(BaseBundle.java:221) at android.os.Bundle.getParcelable(Bundle.java:755) at android.content.Intent.getParcelableExtra(Intent.java:5286) at com.wandersnail.bledemo.MainActivity.onCreate(MainActivity.java:72) at android.app.Activity.performCreate(Activity.java:6092) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2481) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2608)  at android.app.ActivityThread.access$800(ActivityThread.java:178)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:194)  at android.app.ActivityThread.main(ActivityThread.java:5637)  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:959)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)