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

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

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
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
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:16187)
at android.view.View.updateDisplayListIfDirty(View.java:15184)
at android.view.View.draw(View.java:15957)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:16190)
at android.view.View.updateDisplayListIfDirty(View.java:15184)
at android.view.View.draw(View.java:15957)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15179)
at android.view.View.draw(View.java:15957)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15179)
at android.view.View.draw(View.java:15957)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15179)
at android.view.View.draw(View.java:15957)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15179)
at android.view.View.draw(View.java:15957)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:16190)
at android.view.View.updateDisplayListIfDirty(View.java:15184)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:282)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:288)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:323)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2623)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2442)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2075)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1115)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6023)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)

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.

Write tip

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