-
Notifications
You must be signed in to change notification settings - Fork 676
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
Software rendering doesn't support hardware bitmaps #159
Comments
If you're rendering on a software only canvas, you'll need to add |
According to this information by Glide hardware bitmaps have a bug in Android Oreo (26) when used with shared element transitions that is fixed in Oreo 8.1.0 (27). Maybe hardware bitmaps should only be enabled by default for 27+? |
I also receive crashes for devices with Android 8.1. Will enable hardware bitmaps for Android 9+ only. |
@svenjacobs Hardware bitmaps are a pretty big optimization so I'd want to avoid disabling them. For the crashes, can you let me know if the devices you saw crashes for are in this list? There are a number of devices with hardware-specific issues that I'm working on blocking. |
I'm facing the same issue in two different devices that are not in the list Code:
The issue seems to be that i'm using a ShadowLayout as a parent of the image view BTW: If I use |
Hmm that's interesting. What's the stacktrace you're seeing? |
Here's a list of devices as reported by Firebase Crashlytics that crash with a "Software rendering doesn't support hardware bitmaps" during a shared element transition: Android 8.1 A3 Android 8.0 Desire 12+ |
Stacktrace
I've been testing a bit more. My app has a rv with some images (a photo gallery) and the crash happens when I call |
Hey @colinrtwhite I've tested it in the ShadowLayout library sample app and it's crashing, here is the example code, so you can try it.
After a few seconds, the app crashes with the same issue. Maybe we can reopen the issue, what do you think? |
@matir91 Ah thanks for the sample code - sorry missed the last message. I believe this is working as intended as ShadowLayout doesn't seem to support hardware acceleration. Here it's substituting the backing bitmap for the canvas with a software |
Cool, thanks for explain me the cause of this issue! Yes, I can do it. I just wanted to be sure that this issue was not related to something wrong in this library. Thanks! |
I recently had similar issue with 'Moto E5 play' during transitions, I see that on that list which @colinrtwhite shows it is, how should I know if I should enable |
The hardware bitmap blacklist maintains a list of devices that have issues with hardware bitmaps in all cases. Coil will automatically never use hardware bitmaps on those devices. You shouldn't need to copy the list externally. For shared element transitions, check out this recipe. |
Even I use ShadowLayout and got this same Crash,
|
I am also facing the same issue in two different devices that are not in the list; I use neither shadowLayout nor shared element transition, I just use recyclerview with grid layout manager. Error occurs when the user switches between bottom navigation tabs quickly. I use the coil library with following code snippet
Should I add another configuration line to solve the issue? |
I had the same issue with image load with coil in recyclerview adapter. Error occurs when user clicks on item from the recyclerview list to open new fragment to display item details. Solved in the same way and works fine:
|
I had same problem with shared elements but it appears randomly. for me helped this solution:
and just use singleton image loader
idk why, but it works. Also i tried to create it inside dagger module and inject, but it didnt work. |
@suleymanccelik 's solution worked for me while working with coil library |
I got the same error after using ShapeableImageView on Redmi 9s: Android 11 |
the crashed still occurred in Galaxy M12 android 13, our coil version is 2.2.0 https://github.com/coil-kt/coil/pull/308/files#diff-f2033b935fc07028e6e7fc5ae51ac1c0db814bc0426b118222382301a6886e42R107 (checked that galaxy is handled in here), am I missing something? |
So guys, which one is better?
or
? |
Instead of applying |
@pabvald3s any update on this? Did you find some solution to not use |
@radimjanda754 Unfortunately not Sr. |
I have tried basic compose example, as mentioned in their official docs. This issue appears. How can Coil team expect developers to use this code? If they wonder why someone uses concurrent libs, this is the case - basic simple example just do not work. |
Why close ??? issue crash with io.coil-kt.coil3:coil:3.0.0-alpha01 |
java.lang.IllegalArgumentException: Software rendering doesn't support hardware bitmaps
at android.graphics.BaseCanvas.onHwBitmapInSwMode(BaseCanvas.java:550)
at android.graphics.BaseCanvas.throwIfHwBitmapInSwMode(BaseCanvas.java:557)
at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:69)
at android.graphics.BaseCanvas.drawBitmap(BaseCanvas.java:127)
at android.graphics.Canvas.drawBitmap(Canvas.java:1516)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:545)
at android.widget.ImageView.onDraw(ImageView.java:1360)
at android.view.View.draw(View.java:20332)
at android.view.View.draw(View.java:20194)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1767)
at android.view.View.draw(View.java:20340)
at android.view.View.draw(View.java:20194)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5030)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at android.view.View.draw(View.java:20340)
at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4429)
at android.view.View.draw(View.java:20194)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1767)
at android.view.View.draw(View.java:20340)
at android.view.View.draw(View.java:20194)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at android.view.View.draw(View.java:20192)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1767)
at android.view.View.draw(View.java:20340)
at android.view.View.draw(View.java:20194)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at android.view.View.draw(View.java:20192)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at android.view.View.draw(View.java:20192)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at android.view.View.draw(View.java:20192)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at android.view.View.draw(View.java:20192)
at android.view.ViewGroup.drawChild(ViewGroup.java:4395)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4174)
at android.view.View.draw(View.java:20340)
at com.android.internal.policy.DecorView.draw(DecorView.java:781)
at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:3582)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3472)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3244)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2598)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1521)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7437)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:965)
at android.view.Choreographer.doCallbacks(Choreographer.java:777)
at android.view.Choreographer.doFrame(Choreographer.java:709)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
The text was updated successfully, but these errors were encountered: