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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by yuanshuaiding
, 1 year ago
Attempt to invoke virtual method 'void android.graphics.LinearGradient.setLocalMatrix(android.graphics.Matrix)' on a null object reference
via GitHub by YuFong
, 1 year ago
Attempt to invoke virtual method 'void android.graphics.LinearGradient.setLocalMatrix(android.graphics.Matrix)' on a null object reference
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(RainBowText.java:49)
at com.hanks.htextview.animatetext.HText.onDraw(HText.java:80)
at com.hanks.htextview.HTextView.onDraw(HTextView.java:112)
at android.view.View.draw(View.java:16468)
at android.view.View.updateDisplayListIfDirty(View.java:15398)
at android.view.View.getDisplayList(View.java:15420)
at android.view.View.draw(View.java:16190)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15393)
at android.view.View.getDisplayList(View.java:15420)
at android.view.View.draw(View.java:16190)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15393)
at android.view.View.getDisplayList(View.java:15420)
at android.view.View.draw(View.java:16190)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15393)
at android.view.View.getDisplayList(View.java:15420)
at android.view.View.draw(View.java:16190)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15393)
at android.view.View.getDisplayList(View.java:15420)
at android.view.View.draw(View.java:16190)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15393)
at android.view.View.getDisplayList(View.java:15420)
at android.view.View.draw(View.java:16190)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.draw(View.java:16471)
at android.widget.FrameLayout.draw(FrameLayout.java:598)
at android.view.View.updateDisplayListIfDirty(View.java:15398)
at android.view.View.getDisplayList(View.java:15420)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:310)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:316)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:355)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2925)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2722)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2309)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1298)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6982)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:821)
at android.view.Choreographer.doCallbacks(Choreographer.java:606)
at android.view.Choreographer.doFrame(Choreographer.java:576)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:807)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6872)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.