react-native-blur: [Android] Fatal Exception: java.lang.IllegalArgumentException

I am using @react-native-community/blur": "^4.2.0"

Getting below crash issue in Firebase Crashlytics.

image

Fatal Exception: java.lang.IllegalArgumentException: Software rendering doesn't support drawRenderNode
       at android.graphics.Canvas.drawRenderNode(Canvas.java:2317)
       at eightbitlab.com.blurview.RenderEffectBlur.render(RenderEffectBlur.java:2)
       at eightbitlab.com.blurview.PreDrawBlurController.draw(PreDrawBlurController.java:56)
       at eightbitlab.com.blurview.BlurView.draw(BlurView.java:2)
       at android.view.View.draw(View.java:23770)
       at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
       at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:23)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
       at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:3)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 35
  • Comments: 58 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Hey, do you guys have any idea of when will this patch be published on npm?

Should be fixed on latest

I’m facing the same issue on Android API 32. On Android API 30 it’s running fine.

jineshmistry1312 do you know if this problem occurs on Android or iOS for your users?

java.lang.IllegalArgumentException: Software rendering doesn't support drawRenderNode
at android.graphics.Canvas.drawRenderNode(Canvas.java:2317)
at eightbitlab.com.blurview.RenderEffectBlur.render(RenderEffectBlur.java:68)
at eightbitlab.com.blurview.PreDrawBlurController.draw(PreDrawBlurController.java:159)
at eightbitlab.com.blurview.BlurView.draw(BlurView.java:52)
at android.view.View.draw(View.java:22577)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:783)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:755)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:783)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:755)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:783)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:755)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:783)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:755)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at android.view.View.buildDrawingCacheImpl(View.java:21970)
at android.view.View.buildDrawingCache(View.java:21836)
at android.view.View.draw(View.java:22427)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:783)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:755)
at android.view.View.draw(View.java:22707)
at android.view.View.draw(View.java:22577)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:783)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:755)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:783)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:755)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:783)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:755)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at com.facebook.react.ReactRootView.dispatchDraw(ReactRootView.java:255)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at android.view.View.draw(View.java:22575)
at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
at android.view.View.draw(View.java:22707)
at eightbitlab.com.blurview.PreDrawBlurController.updateBlur(PreDrawBlurController.java:115)
at eightbitlab.com.blurview.PreDrawBlurController$1.onPreDraw(PreDrawBlurController.java:50)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1093)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3362)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2179)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8787)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1037)
at android.view.Choreographer.doCallbacks(Choreographer.java:845)
at android.view.Choreographer.doFrame(Choreographer.java:780)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Those who need a patch asap can try this (works for me, but use on your own risk)

Some details after research:

  • In latest updates, the package uses BlurView@2.0.2, so there is an affecting line.

  • Usage of RenderEffectBlur throws the IllegalArgumentException, because the drawRenderNode function used in the algorithm requires hardware acceleration.

  • Usage of hardwareAccelerated=true in AndroidManifest doesn’t resolve the issue

My app crashes under a certain condition 100%. In my case, I navigated to a screen with react-navigation and the screen has a scrollview with a blur view in it. When I pop the screen while the blur view is displaying, it crashes, but if the blur view is not displaying on the screen because I scrolled down or up then it doesn’t crash. I hope this helps you guys figure out what’s going on.

This is algo happening to me but only when I upgraded to react navigation 6:

before upgrade (working without crashes):

  "@react-navigation/bottom-tabs": "^5.10.6",
  "@react-navigation/drawer": "^5.10.6",
  "@react-navigation/native": "^5.8.6",
  "@react-navigation/stack": "^5.12.3",
  "react-native-safe-area-context": "^3.1.8",
  "react-native-screens": "^2.2.0",

after upgrade (crashes every time I open a screen with <BlurView /> component):

    "@react-navigation/bottom-tabs": "^6.3.3",
    "@react-navigation/drawer": "^6.4.4",
    "@react-navigation/native": "^6.0.12",
    "@react-navigation/stack": "^6.2.3",
    "react-native-safe-area-context": "^4.3.3",
    "react-native-screens": "^3.17.0",

i am also facing the same kind of issue. For example i am going from screen A to B , then from B to C. But if i goBack from screen C to B it crashes every single time.

The android library author said he would try to release a new version with a fix, so we’ll update when it’s ready

Same problem on React native 0.68.2 and react-native-blur 4.3.0.

@Kureev & everyone else here, I cannot reproduce this on real device / simulator running android 12. Please provide a a reproduction, I would like to address this. In the meantime @artyorsh patch is valid, but it’s basically running the less optimised non hardware-accelerated variant all the time, but at least it’s not crashing…