-
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
Intermittent crash when navigating to a page containing images #9011
Comments
Does this have issues with all images? Just to be safe when we test, can you provide the link to an image that fails - even if it is not your actual image. Does it happen on a blank page with 2 image views, or is this image being used by additional UI elements - like shell icons, tabs or something else? |
Hi @brabebhin. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@mattleibow any image will do. This is usually easy to reproduce with a shell app with 2 tabs. On one tab, a collection view with images. On the second tab, 2 images with same source file. While scrolling the list in the first tab, switch to the second tab. It is important that the collection view contains an image linked to the source of the 2 images in the other tab. I will try to create a simple app to demonstrate the issue but it is similar to #9007 #8809 |
Hi @brabebhin. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Ok, I will try to create a simple reproduce sample in the weekend. |
(this looks like a thread race to me) Some more stack traces `07-29 21:19:23.403 9505 9505 E AndroidRuntime: java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@106bd9d ` |
Hi @jfversluis It took me some time to do it but here's the sample https://github.com/brabebhin/maui-andoid-image-crash Run the app. The first time you run it, navigate to the 2nd tab, and wait it out until it generates its 1000 images. Repeat until the crush occurs. I've noticed there's a higher chance if your phone is in landscape mode. |
Any progress on this? MAUI is essentially unusable on Android. |
Same problem scrolling images in CollectionView. |
Yes. I suspect scrolling plays a part too, but sometimes there's no list involved. This is very annoying bug. |
Any news on this? |
I encountered this too. I tried to use GraphicsView to draw images manually, but on the one hand the Image.Resize method always throws an ObjectDisposedException, on the other hand the image diaplayed is just like a pixel-art. Maybe it's because GraphicsView does not support hidpi or whatever. BTW, I'm thinking of migrating back to Xamarin. It's just so urgent for me to get my app working without this fatal bug.😥 Does anybody know if Xamarin has the same problem too? Any useful information on this will be highly appreciated.🙏 |
Setting the HOWEVER, I found a solution that does work in my case. I'm using SkiaSharp for image manipulation stuff, and I just discovered that they have SKBitmapImageSource. So I switched over to that instead and my crashes are gone! 🎉 My code now looks like this:
|
@jfversluis Is a fix being worked on for this? |
This is a blocking issue on Android. Incredibly easy to reproduce: a collection view with multiple images loaded from a Uri will 100% crash the app every single time. |
do you use it on android or windows ? |
Just for Android. I've honestly not been testing my app on Windows yet, but the stack trace shows a bunch of Android native classes. |
Getting the same issue as everyone else. Absolute show stopper for my app. |
Also encountering this issue on Android when cycling through a number of ImageSources which is really frustrating. |
Same issue here. |
I had the same problem again. |
Having the same issue here. Using both size requests doesn't fix it, nor does FromUri() or anything else that I've found so far. Really looking like migrating back to Xamarin Forms is the only answer, which really sucks. |
I spent a few hours to analyze this problem. This bug was created following this pull request: #7348 While waiting for Microsoft to permanently fix this bug, the workaround consists of redoing the clear before each source image change. Below is an example of code to add the clear in the source image mapping. This workaround is applicable to the following bug
|
Description
I randomly get this error when navigating to a content page that displays an image twice (uses same URL for the image but with technically using 2 different instances).
This seems to originate from the version of glide built into MAUI
Steps to Reproduce
https://github.com/brabebhin/maui-andoid-image-crash
Run the app. The first time you run it, navigate to the 2nd tab, and wait it out until it generates its 1000 images.
Once the images pop up, start scrolling the list.
While the list is scrolling, go to the first tab, click the button several times then go back to the second tab and scroll back up.
Repeat until the crush occurs. I've noticed there's a higher chance if your phone is in landscape mode.
DO try this on a phone (i tried on Samsung galaxy note 10+). Don't know if it can be done on emulator.)
Version with bug
6.0.408 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12
Did you find any workaround?
Nope.
Relevant log output
The text was updated successfully, but these errors were encountered: