java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.LinearGradient.setLocalMatrix(android.graphics.Matrix)' on a null object reference

GitHub | YuFong | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    GitHub comment 33#245207667

    GitHub | 6 months ago | YuFong
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.LinearGradient.setLocalMatrix(android.graphics.Matrix)' on a null object reference
  2. 0

    直接使用rainbow动画样式会报NullPointException

    GitHub | 7 months ago | yuanshuaiding
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.LinearGradient.setLocalMatrix(android.graphics.Matrix)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.graphics.LinearGradient.setLocalMatrix(android.graphics.Matrix)' on a null object reference

      at com.hanks.htextview.animatetext.RainBowText.drawFrame()
    2. com.hanks.htextview
      HTextView.onDraw
      1. com.hanks.htextview.animatetext.RainBowText.drawFrame(RainBowText.java:49)
      2. com.hanks.htextview.animatetext.HText.onDraw(HText.java:80)
      3. com.hanks.htextview.HTextView.onDraw(HTextView.java:112)
      3 frames
    3. Android Platform
      View.draw
      1. android.view.View.draw(View.java:16187)
      2. android.view.View.updateDisplayListIfDirty(View.java:15184)
      3. android.view.View.draw(View.java:15957)
      4. android.view.ViewGroup.drawChild(ViewGroup.java:3609)
      5. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
      6. android.view.View.draw(View.java:16190)
      7. android.view.View.updateDisplayListIfDirty(View.java:15184)
      8. android.view.View.draw(View.java:15957)
      9. android.view.ViewGroup.drawChild(ViewGroup.java:3609)
      10. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
      11. android.view.View.updateDisplayListIfDirty(View.java:15179)
      12. android.view.View.draw(View.java:15957)
      13. android.view.ViewGroup.drawChild(ViewGroup.java:3609)
      14. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
      15. android.view.View.updateDisplayListIfDirty(View.java:15179)
      16. android.view.View.draw(View.java:15957)
      17. android.view.ViewGroup.drawChild(ViewGroup.java:3609)
      18. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
      19. android.view.View.updateDisplayListIfDirty(View.java:15179)
      20. android.view.View.draw(View.java:15957)
      21. android.view.ViewGroup.drawChild(ViewGroup.java:3609)
      22. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
      23. android.view.View.updateDisplayListIfDirty(View.java:15179)
      24. android.view.View.draw(View.java:15957)
      25. android.view.ViewGroup.drawChild(ViewGroup.java:3609)
      26. android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
      27. android.view.View.draw(View.java:16190)
      27 frames
    4. Android
      PhoneWindow$DecorView.draw
      1. com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2946)
      1 frame
    5. Android Platform
      ActivityThread.main
      1. android.view.View.updateDisplayListIfDirty(View.java:15184)
      2. android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:282)
      3. android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:288)
      4. android.view.ThreadedRenderer.draw(ThreadedRenderer.java:323)
      5. android.view.ViewRootImpl.draw(ViewRootImpl.java:2623)
      6. android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2442)
      7. android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2075)
      8. android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1115)
      9. android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6023)
      10. android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
      11. android.view.Choreographer.doCallbacks(Choreographer.java:670)
      12. android.view.Choreographer.doFrame(Choreographer.java:606)
      13. android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
      14. android.os.Handler.handleCallback(Handler.java:739)
      15. android.os.Handler.dispatchMessage(Handler.java:95)
      16. android.os.Looper.loop(Looper.java:148)
      17. android.app.ActivityThread.main(ActivityThread.java:5461)
      17 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      1 frame
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
      2 frames