Repository navigation
Description
Apple platform
iOS
Framework version
net9.0-*
Affected platform version
.NET 9.0.306, MAUI Workload 9.0.306
Description
We have an application that was migrated from Xamarin to MAUI. During that process, the images were managed in the following manner.
Android
All images are in the /Platform/Android/Resources/Drawable_** folders.
Images contain a single copy and are named such as accuracy.png
iOS
All images are in the /Platform/iOS/Resources folder.
Each image has 3 sizes with the same naming process accuracy.png 'accuracy_2x.pngandaccuracy_3x.png'
.csproj configuration
Within the csproj there are the following entries that "remove" the iOS images and add them back as MAUI Images
<None Remove="Platforms\iOS\Resources\accuracy.png" />
<None Remove="Platforms\iOS\Resources\accuracy_2x.png" />
<None Remove="Platforms\iOS\Resources\accuracy_3x.png" />
<MauiImage Include="Platforms\iOS\Resources\accuracy.png" />
<MauiImage Include="Platforms\iOS\Resources\accuracy_2x.png" />
<MauiImage Include="Platforms\iOS\Resources\accuracy_3x.png" />
```
## Existing Behavior
Using this process, the team was able to continue using images such as the one above, using code like the following.
```` xaml
<Image
Source="accuracy"
WidthRequest="100"
HeightRequest="100" />Everything has worked correctly from at least .NET 8.0 -> 9.0.305 until xCode 16.
Failing Behavior
After updating the project to 9.0.306 & xCode 26, the application builds without any noticeable additional errors. The Android application artifact works well; however, the iOS application is no longer able to render ANY image asset.
Expected Behavior
This process was used, following older documentation on image management, due to the extremely large number of images used (This application has more than 100k monthly devices in use, so limiting risk and scope was a goal in the migration) We did not expect to see a complete loss of resources, with a midline release within the same version of .NET.
Steps to Reproduce
- Build the project using 9.0.305
- Validate functionality
- Update to target 9.0.306
- Android is unaffected, but iOS fails to render ANY images.
Did you find any workaround?
The only workaround we have found so far is to roll back, we are investigating completely rebuilding all assets to have a single file per with the single project structure, but that isn't viable at this time.
Build logs
No response
Activity
rolfbjarne commentedon Oct 15, 2025
Do you build on Windows or on Mac? If you build on Windows, does the same thing happen if you try directly on the Mac instead?
Can you get an MSBuild binlog and attach it here (or privately).
mitchelsellers commentedon Oct 15, 2025
@rolfbjarne We are building in GitHub Actions using the macos-15 image.
I just created an issue and uploaded the logs that I have, due to production support issues, it will take some time to get more detailed logs, but I can get those if needed as well
EDIT: I was able to upload the binlog as requested. I can provide the ipa as well
rolfbjarne commentedon Oct 15, 2025
@mitchelsellers what's the link to the issue you created with the logs?
mitchelsellers commentedon Oct 15, 2025
@rolfbjarne https://developercommunity.microsoft.com/t/Providing-Private-Information-for-MAUI-i/10983232?scope=follow
rolfbjarne commentedon Oct 16, 2025
I think I see what's happening: we started detecting if multiple image files with the same final app bundle location are added to the build, and then instead of randomly choosing one of the files that would win, we now don't pick any and instead show a warning:
This seems to happen because MAUI will resize images, and add those resized images to the build, without removing the originals.
I think this would work as a workaround (just add it to the main project):
can you try this and see if it works for you?
mitchelsellers commentedon Oct 16, 2025
@rolfbjarne Yes, we will give this a try.
I assume the "right" answer for this situation is to switch to the new & proper image management, but it will be a larger ordeal for us, as that would require changing the Source values for all of our items, as right now they are displayed without the .png endings.
mitchelsellers commentedon Oct 17, 2025
@rolfbjarne We have done initial testing with your snippet, and it does appear that the functionality is restored. Can you confirm my suggestion/note regarding the breaking change to switch to the "proper" behavior.
rolfbjarne commentedon Oct 17, 2025
This is a bug on our side and we'll fix it, there's no need for you to do anything (except keep the workaround until we've released the fix).
rolfbjarne commentedon Oct 17, 2025
Actually, thinking a bit more, this is what happens:
Platforms/iOS/Resources/*are automatically added to the build to be copied to the app bundle (technically they're added to theBundleResourceitem group, because all items in theBundleResourceitem group are copied to the app bundle).MauiImageitem group, which will make MAUI process these images and eventually add them to theBundleResourceitem group (so that they're copied to the app bundle).I believe there are multiple solutions:
Put
MauiImagefiles in a separate location (sayPlatforms/iOS/MauiImage/for instance). This way they won't be added to theBundleResourceitem group in step 1 above.Remove any
MauiImagefromBundleResource- this is the workaround I mentioned earlier, but I believe it can be a simpler change, just a one liner after all theMauiImageentries:Disable automatic inclusion of items, by setting the property
EnableDefaultiOSItems=false(note that you may rely on the automatic inclusion for other types of resources, so those would have to be re-added manually to the project file).rolfbjarne commentedon Oct 17, 2025
I've added a section about this to our release notes (https://github.com/dotnet/macios/releases/tag/dotnet-9.0.1xx-xcode26.0-9752) - under "Breaking changes"
mitchelsellers commentedon Oct 17, 2025
@rolfbjarne In some ways, this makes sense, but in this specific situation, I'm curious about exactly what we should do for long-term alignment.
Our resources for iOS, as noted, are here
/Platforms/iOS/ResourcesOur resources for Android as noted are here
/Platforms/Android/drawable-**/accuracy.pngwith a single asset file in each of the respective directories.Currently, in the .csproj we have the following
The biggest question is what happens when removing the items from the bundle resources behavior
The current "expectation" is with the way this was done. It is as follows, when we reference this with a source of "accuracy" within our application.
Is this what is happening when we follow the steps that have us remove the items from BundleResource?
Secondarily, would it be proper/prudent/just for us to step away from this pattern, and do the follwoing
/Resources/Imagesfolder in the project rootGiven the size, deployment nature of this application, and the fact that we provide guidance for other development teams it would be great to knw what we "should" be doing for long-term support.
I believe we could still reference them with the "accuracy" name and not need to change to "accuracy.png"
rolfbjarne commentedon Oct 17, 2025
Yes, removing the items from BundleResource will get you the same behavior as in the previous release (in fact removing the items from BundleResource should work with the previous release as well; this is a safe fix in this regard).
This way is what MAUI projects typically do, and it's also how it's done in this guide: https://learn.microsoft.com/dotnet/maui/user-interface/images/images
So while your current way is valid, doing things the typical way lessens the risk of running into issues that nobody else does (such as this one).
My recommendation would be to:
/Resources/Images folder in the project root (and whatever other work that entails).Yes, this shouldn't change.
rolfbjarne commentedon Oct 21, 2025
I'm moving this to dotnet/maui, for consideration there:
The issue is that if an image is in the
Platforms/iOS/Resourcesdirectory, and then the project file adds that image to the build as a@(MauiImage), then the build will fail because the images MAUI automatically generates from@(MauiImage)conflict with the image in thePlatforms/iOS/Resourcesdirectory, which were automatically added to@(BundleResource).My suggested fix for MAUI would be to remove any
@(MauiImage)from@(BundleResource)after automatically generating/resizetizing images (and adding those images to@(BundleResource)).jfversluis commentedon Oct 21, 2025
Reading through this I'm not exactly sure what is still expected here. What is the current status? Are you still hitting this @mitchelsellers ? It seems like maybe a project specific configuration thing you had going on?
8 remaining items
rolfbjarne commentedon Oct 21, 2025
Yes, this is a change in the iOS workload, we changed "pick which image to put in the app randomly" to "don't pick anything and warn about it"
Connect-and-Exchange commentedon Oct 24, 2025
Let's hope it gets fixed soon as we ran into the team issue. Initially we thought LeadTools createda bug in their new release, it seems it wasn't their problem.
1>Resources\Raw\error_icon.png : warning MT7156: The BundleResource item 'Resources\Raw\error_icon.png' was ignored, because there's another item with the same LogicalName ('error_icon.png')
1>C:\Projects\RxWhizzMaui\obj\Debug\net9.0-ios\ios-arm64\resizetizer\r\Resources\error_icon.png : warning MT7156: The BundleResource item 'C:\Projects\RxWhizzMaui\obj\Debug\net9.0-ios\ios-arm64\resizetizer\r\Resources\error_icon.png' was ignored, because there's another item with the same LogicalName ('error_icon.png')
1>Resources\Raw\feedback_menu.png : warning MT7156: The BundleResource item 'Resources\Raw\feedback_menu.png' was ignored, because there's another item with the same LogicalName ('feedback_menu.png')
1>C:\Projects\RxWhizzMaui\obj\Debug\net9.0-ios\ios-arm64\resizetizer\r\Resources\feedback_menu.png : warning MT7156: The BundleResource item 'C:\Projects\RxWhizzMaui\obj\Debug\net9.0-ios\ios-arm64\resizetizer\r\Resources\feedback_menu.png' was ignored, because there's another item with the same LogicalName ('feedback_menu.png')
kubaflo commentedon Oct 18, 2026
Thank you for reporting this and for helping investigate the image-resource conflict. This report targets .NET MAUI 9, which reached end of support on May 12, 2026, according to the .NET MAUI support policy. We are closing it as not planned for that unsupported release, rather than marking the issue as fixed.
Please try the latest servicing release of .NET MAUI 10. If the same issue still occurs, please comment here with an updated reproduction and your workload and Xcode versions so we can reopen and investigate it on a supported release.