Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on RenderScript.validate() #111

Closed
AAAstorga opened this issue Feb 4, 2020 · 5 comments
Closed

NullPointerException on RenderScript.validate() #111

AAAstorga opened this issue Feb 4, 2020 · 5 comments

Comments

@AAAstorga
Copy link

Hello,

I received a crash report for an android app I use BlurView with. I've only seen this once, but I thought the stack trace might be useful for future debugging. Let me know if I can be of any more assistance. The stack trace is:

Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.renderscript.RenderScript.validate()' on a null object reference at android.renderscript.BaseObj.getID(BaseObj.java:53) at android.renderscript.Script.setVar(Script.java:378) at android.renderscript.ScriptIntrinsicBlur.setRadius(ScriptIntrinsicBlur.java:80) at eightbitlab.com.blurview.RenderScriptBlur.blur(RenderScriptBlur.java:58) at eightbitlab.com.blurview.BlockingBlurController.blurAndSave(BlockingBlurController.java:240) at eightbitlab.com.blurview.BlockingBlurController.updateBlur(BlockingBlurController.java:154) at eightbitlab.com.blurview.BlockingBlurController$1.onPreDraw(BlockingBlurController.java:61) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:977) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2631) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1565) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7612) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1034) at android.view.Choreographer.doCallbacks(Choreographer.java:845) at android.view.Choreographer.doFrame(Choreographer.java:780) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1020) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:205) at android.app.ActivityThread.main(ActivityThread.java:6892) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)

@Dimezis
Copy link
Owner

Dimezis commented Feb 4, 2020

The only assumption I can make is that you're somehow reusing RenderScriptBlur object between multiple .setupWith calls.
This might be the cause. Can you share the overall BlurView usage flow?

@AAAstorga
Copy link
Author

Hey @Dimezis sorry for the long delay. Here is the code that sets up all the blur information.

    public void setBlurredView(View viewToBlur) {
        viewToBlur.setBackgroundColor(Color.TRANSPARENT);
        this.setupWith((ViewGroup)viewToBlur)
            .setFrameClearDrawable(getBackground())
            .setBlurAlgorithm(new RenderScriptBlur(context))
            .setBlurRadius(25f)
            .setBlurEnabled(true)
            .setBlurAutoUpdate(false)
            .setHasFixedTransformationMatrix(false);
        this.invalidate();
    }

This method is on a custom class

public final class CustomBlurView extends BlurView

Let me know if there is anymore information I can provide. I am starting to notice more crashes with the same stack trace.

@iabhisheksahu
Copy link

Hey @Dimezis sorry for the long delay. Here is the code that sets up all the blur information.

    public void setBlurredView(View viewToBlur) {
        viewToBlur.setBackgroundColor(Color.TRANSPARENT);
        this.setupWith((ViewGroup)viewToBlur)
            .setFrameClearDrawable(getBackground())
            .setBlurAlgorithm(new RenderScriptBlur(context))
            .setBlurRadius(25f)
            .setBlurEnabled(true)
            .setBlurAutoUpdate(false)
            .setHasFixedTransformationMatrix(false);
        this.invalidate();
    }

This method is on a custom class

public final class CustomBlurView extends BlurView

Let me know if there is anymore information I can provide. I am starting to notice more crashes with the same stack trace.

Hi @AAAstorga, were you able to fix this crash issue, have been facing this issue for days now.

@AAAstorga
Copy link
Author

@iabhisheksahu No I have not. We are still seeing it

@Dimezis
Copy link
Owner

Dimezis commented Mar 22, 2023

Closing due to inactivity and lack of steps to reproduce.
Possibly related to this

@Dimezis Dimezis closed this as completed Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants