dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

Images are not showing on Android - MAUI 9.0.0 #25843

Closed LeoJHarris closed 1 day ago

LeoJHarris commented 1 week ago

Description

Images are not showing on Android when updating to latest 9.0.0 MAUI, rolling back the images displaying properly again.

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/LeoJHarris/ImageNotShowing_Bug.git

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.93 SR9.3

Affected platforms

Android

Affected platform versions

Android 35

Did you find any workaround?

Rolling back MAUI

Relevant log output

similar-issues-ai[bot] commented 1 week ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

LeoJHarris commented 1 week ago

Only tested in Debug config

Jcardif commented 4 days ago

same issue after upgrading to .net 9

Zhanglirong-Winnie commented 3 days ago

Hi, @LeoJHarris Could you provide us with a sample project so we can investigate it further? Looking forward to your reply!

Redth commented 3 days ago

@LeoJHarris one other thought is that maybe deleting the bin/ and obj/ folders and trying again to see if the issue remains. I wonder if something is cached in the intermediate output that's causing some issues for a project built for net8.0 then upgraded in place and incrementally built for net9.0. Just a thought.

LeoJHarris commented 3 days ago

@Redth No luck unfortunately on the bin and obj folders.

@Zhanglirong-Winnie since the issue impacts a pretty large enterprise application Ill see how I can strip it down to a sample, when I created a new project the image shows correctly, but Ill see what I can do. Been fairly tied up.

mattleibow commented 3 days ago

Are there any errors in the logs? Either the VS debug log or the logcat?

if you add a random page in the app - aka replace the main page with a blank page - do images load in there?

LeoJHarris commented 2 days ago

I have sample repo available here https://github.com/LeoJHarris/ImageNotShowing_Bug.git

XAML:

Result:

Image

Not sure if this issue is actually related to the MAUI Community Toolkit? @Jcardif are you using an ImageResourceConverter where the images do not not load? @jfversluis can you confirm if the usage is correct here?

LeoJHarris commented 2 days ago

Seems to be inline with the documentation.

Image

mattleibow commented 2 days ago

The image is not marked as embedded resource. But also, this is using the community toolkit so maybe move it there for better troubleshooting on their code.

LeoJHarris commented 2 days ago

@mattleibow I have updated the .png file to an embedded resource although when I first created the project it already was a MauiImage.

That being said the issue still persists, I have updated the sample.

LeoJHarris commented 1 day ago

As I have submitted a ticket on Community Toolkit Ill close one this for now.