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

Android error: Software rendering doesn't support hardware bitmaps caused by PreDrawBlurController. #624

Open
Anas-7 opened this issue Jul 26, 2024 · 1 comment

Comments

@Anas-7
Copy link

Anas-7 commented Jul 26, 2024

We are facing this error when we try to integrate a library that uses Coil in our app, and had first written the issue below here. I tried using the fixes mentioned here but they don't work and neither does the latest version, i.e., 4.4.0

Describe the bug
App shuts down when trying to navigate to hamburger menu made with @react-navigation/drawer that contains a Blurview. Currently, we show a feed where images are displayed with TurboImage. The images load and cache correctly, but on clicking the menu the app closes.

We tried a different library, but faced a similar error. Our crashlytics log point to an error related to Coil and Blurview is attached below.

Expected behavior
The issue is due to coil.drawable.CrossfadeDrawable.draw and might have something to do with this

Logs

The two relevant lines according to me are:

eightbitlab.com.blurview.PreDrawBlurController.updateBlur (PreDrawBlurController.java:119)
eightbitlab.com.blurview.PreDrawBlurController$1.onPreDraw (PreDrawBlurController.java:50)

The complete log is:

Fatal Exception: java.lang.IllegalArgumentException: Software rendering doesn't support hardware bitmaps
at android.graphics.BaseCanvas.throwIfHwBitmapInSwMode(BaseCanvas.java:726)
at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:81)
at android.graphics.BaseCanvas.drawBitmap(BaseCanvas.java:139)
at android.graphics.Canvas.drawBitmap(Canvas.java:1665)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:549)
at coil.drawable.CrossfadeDrawable.draw(CrossfadeDrawable.kt:79)
at android.widget.ImageView.onDraw(ImageView.java:1446)
at android.view.View.draw(View.java:24627)
at android.view.View.draw(View.java:24499)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24630)
at android.view.View.draw(View.java:24499)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24630)
at android.view.View.draw(View.java:24499)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24630)
at android.widget.ScrollView.draw(ScrollView.java:2019)
at com.facebook.react.views.scroll.ReactScrollView.draw(ReactScrollView.java:587)
at android.view.View.draw(View.java:24499)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24630)
at android.widget.ScrollView.draw(ScrollView.java:2019)
at com.facebook.react.views.scroll.ReactScrollView.draw(ReactScrollView.java:587)
at android.view.View.draw(View.java:24499)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24630)
at android.view.View.draw(View.java:24499)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24630)
at android.view.View.draw(View.java:24499)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24630)
at android.view.View.draw(View.java:24499)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24630)
at android.view.View.draw(View.java:24499)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:836)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:809)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at com.facebook.react.ReactRootView.dispatchDraw(ReactRootView.java:296)
at android.view.View.draw(View.java:24497)
at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
at android.view.View.draw(View.java:24630)
at eightbitlab.com.blurview.PreDrawBlurController.updateBlur(PreDrawBlurController.java:119)
at eightbitlab.com.blurview.PreDrawBlurController$1.onPreDraw(PreDrawBlurController.java:50)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1176)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4029)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2718)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9937)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1406)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
at android.view.Choreographer.doCallbacks(Choreographer.java:1015)
at android.view.Choreographer.doFrame(Choreographer.java:945)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1389)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8592)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Smartphone (please complete the following information):

  • Device: [Pixel 8a]
  • OS: [Android]
  • Version [14]

Additional context
This seems to be triggered due to hardware acceleration. I tried testing it with android:hardwareAcceleration="false" and while the code didn't crash, the performance suffered way more than acceptable for us. I'll try and post a reproducible example in a day or two.

@MadeinFrance
Copy link

Exact same issue on 4.4.1 simulator + real device.

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

2 participants