-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
CollectionView throws Recycled-Exception while loading Images with Web-URL #9712
Comments
Same happens if I try to download all images before and cache them all into files and set following XAML:
So it's not related to the UriSource |
Can anyone provide a workaround for this? I tried different approaches (e.g. via custom handler to deactivate recycling) but the only solution I is to set a fix height. On tablets, this won't work, the images can't be displayed without cropping them. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Today i use Image show PDF image, when i change page and set new page Image, i get this bug: "Java.Lang.RuntimeException: 'Canvas: trying to use a recycled bitmap android.graphics.Bitmap".
I feel this is when change Image, old Image still use old bitmap, have old bitmap reference, so i change my code, then this bug disappear when change page:
Hope it can help someone. |
Any fix for this, xD I'm going to have to migrate the project to Xamarin. |
@Phantom-KNA for now - not that I know. But maybe you can try use .NET 7 which was releases a couple of days ago? They mentioned CollectionView improvements, maybe also some fixes in the new relates MAUI version.. |
Thx my friend i try!!! |
It's still crashing in .NET7. I have CarouselView with ItemSource = {Binding Example} with five different Images. Sometimes when I try to scroll them fast the app crashes with "java.lang.runtimeexception: 'canvas: trying to use a recycled bitmap android.graphics.bitmap@d9cfbb1' net maui". |
Hello friend, in my project I was using as ItemSource of the Collection View to objects of type: |
Hello Everyone, |
I solved my problem using Image.MinimumHeightRequest property. Without it, I was having the problem on Android.
|
Hello lovely human, thank you for your comment on this issue. Because this issue has been closed for a period of time, please strongly consider opening a new issue linking to this issue instead to ensure better visibility of your comment. Thank you! |
try this code in your MauiProgram class
|
Hello lovely human, thank you for your comment on this issue. Because this issue has been closed for a period of time, please strongly consider opening a new issue linking to this issue instead to ensure better visibility of your comment. Thank you! |
Description
CollectionView throws
Java.Lang.RuntimeException: 'Canvas: trying to use a recycled bitmap android.graphics.Bitmap
for Web-URL images.Caching is disabled to receive new images. In my real scenario, I have different URLs and Caching enabled, but same issue.
Steps to Reproduce
Expected outcome: List can be scrolled, no crash
Actual outcome: Recycled exception gets thrown - app crashes
Repository to reproduce: TestRepo
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12
Did you find any workaround?
It seems to be working, if I set
HeightRequest
andWidthRequest
to the original image size. But I don't know the size of the images, therefore I like to useAspect="AspectFit"
. But this also leads to a crash.Relevant log output
The text was updated successfully, but these errors were encountered: