java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothGattCharacteristic.setValue(byte[])' on a null object reference

Stack Overflow | BlueGene | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Android app crash on Bluetooth LE write

    Stack Overflow | 7 months ago | BlueGene
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothGattCharacteristic.setValue(byte[])' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothGattCharacteristic.setValue(byte[])' on a null object reference

      at pm.puremoco.BluetoothLeService.WriteValue()
    2. pm.puremoco
      frag_moviesetlinear$3.onFinish
      1. pm.puremoco.BluetoothLeService.WriteValue(BluetoothLeService.java:70)
      2. pm.puremoco.frag_moviesetlinear$3.onFinish(frag_moviesetlinear.java:266)
      2 frames
    3. Android Platform
      ActivityThread.main
      1. android.os.CountDownTimer$1.handleMessage(CountDownTimer.java:127)
      2. android.os.Handler.dispatchMessage(Handler.java:102)
      3. android.os.Looper.loop(Looper.java:158)
      4. android.app.ActivityThread.main(ActivityThread.java:7224)
      4 frames
    4. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      1 frame
    5. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
      2 frames