Skip to content

Application Built with xCode 26 & .NET 9 Doesn't Show Images #32106

Closed as not planned

Description

@mitchelsellers

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

  1. Build the project using 9.0.305
  2. Validate functionality
  3. Update to target 9.0.306
  4. 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

  1. rolfbjarne commented on Oct 15, 2025

    @rolfbjarne
    Member

    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).

  2. mitchelsellers commented on Oct 15, 2025

    @mitchelsellers
    Author

    @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

  3. rolfbjarne commented on Oct 15, 2025

    @rolfbjarne
    Member

    @mitchelsellers what's the link to the issue you created with the logs?

  4. rolfbjarne commented on Oct 16, 2025

    @rolfbjarne
    Member

    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:

    Platforms/iOS/Resources/accuracy.png warning MT7156: The BundleResource item 'Platforms/iOS/Resources/accuracy.png' was ignored, because there's another item with the same LogicalName ('accuracy.png')
    obj/Release/net9.0-ios/ios-arm64/resizetizer/r/Resources/accuracy.png warning MT7156: The BundleResource item 'obj/Release/net9.0-ios/ios-arm64/resizetizer/r/Resources/accuracy.png' was ignored, because there's another item with the same LogicalName ('accuracy.png')
    

    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):

    <Target Name="RemoveResizedImages" AfterTargets="ResizetizeImages">
        <ItemGroup>
            <BundleResource Remove="@(MauiImage)" />
        </ItemGroup>
    </Target>

    can you try this and see if it works for you?

  5. mitchelsellers commented on Oct 16, 2025

    @mitchelsellers
    Author

    @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.

  6. mitchelsellers commented on Oct 17, 2025

    @mitchelsellers
    Author

    @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.

  7. rolfbjarne commented on Oct 17, 2025

    @rolfbjarne
    Member

    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.

    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).

  8. rolfbjarne commented on Oct 17, 2025

    @rolfbjarne
    Member

    Actually, thinking a bit more, this is what happens:

    1. All images in Platforms/iOS/Resources/* are automatically added to the build to be copied to the app bundle (technically they're added to the BundleResource item group, because all items in the BundleResource item group are copied to the app bundle).
    2. You add images to the MauiImage item group, which will make MAUI process these images and eventually add them to the BundleResource item group (so that they're copied to the app bundle).
    3. This results in multiple different images being copied to the same location in the app bundle - previously it was undefined which image would end up in the app bundle, and now it's defined (neither image).

    I believe there are multiple solutions:

    1. Put MauiImage files in a separate location (say Platforms/iOS/MauiImage/ for instance). This way they won't be added to the BundleResource item group in step 1 above.

    2. Remove any MauiImage from BundleResource - this is the workaround I mentioned earlier, but I believe it can be a simpler change, just a one liner after all the MauiImage entries:

      <ItemGroup>
      	<!-- ... -->
      	<MauiImage Include="Platforms\iOS\Resources\x_red_3x.png" />
      	<!-- Remove any MauiImage from BundleResource, because they'll be re-added later on, once MAUI has processed/resized them properly -->
      	<BundleResource Remove="@(MauiImage)" />
      </ItemGroup>
    3. 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).

  9. rolfbjarne commented on Oct 17, 2025

    @rolfbjarne
    Member

    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"

  10. mitchelsellers commented on Oct 17, 2025

    @mitchelsellers
    Author

    @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/Resources

    • accuracy.png
    • accuracy_2x.png
    • accuracy_3x.png

    Our resources for Android as noted are here /Platforms/Android/drawable-**/accuracy.png with a single asset file in each of the respective directories.

    Currently, in the .csproj we have the following

    <None Remove="Platforms\iOS\Resources\accuracy.png" /> 
    <MauiImage Include="Platforms\iOS\Resources\accuracy.png" />
    <MauiImage Include="Platforms\iOS\Resources\accuracy_2x.png" />
     <MauiImage Include="Platforms\iOS\Resources\accuracy_3x.png" />
    

    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.

    • Android - The properly sized image for the device is used
    • iOS - The properly sized image for the device resolution is selected

    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

    • Remove all image assets from the platform specific resource paths listed above
    • Standardize on a single-sized image for each and add them to the /Resources/Images folder in the project root

    Given 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"

  11. rolfbjarne commented on Oct 17, 2025

    @rolfbjarne
    Member

    Is this what is happening when we follow the steps that have us remove the items from BundleResource?

    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).

    Secondarily, would it be proper/prudent/just for us to step away from this pattern, and do the follwoing

    • Remove all image assets from the platform specific resource paths listed above
    • Standardize on a single-sized image for each and add them to the /Resources/Images folder in the project root

    Given the size, deployment nature of this application, and the fact that we provide guidance for other development teams it would be great to know what we "should" be doing for long-term support.

    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:

    • Short term: go for the BundleResource removal fix
    • Longer term: plan to move the images to the /Resources/Images folder in the project root (and whatever other work that entails).

    I believe we could still reference them with the "accuracy" name and not need to change to "accuracy.png"

    Yes, this shouldn't change.

  12. rolfbjarne commented on Oct 21, 2025

    @rolfbjarne
    Member

    I'm moving this to dotnet/maui, for consideration there:

    The issue is that if an image is in the Platforms/iOS/Resources directory, 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 the Platforms/iOS/Resources directory, 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)).

  13. transferred this issue fromdotnet/macioson Oct 21, 2025
  14. jfversluis commented on Oct 21, 2025

    @jfversluis
    Member

    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?

  15. 8 remaining items

  16. removed
    s/needs-attention
    on Oct 21, 2025
  17. rolfbjarne commented on Oct 21, 2025

    @rolfbjarne
    Member

    Its interesting how this then seemingly changed in recent versions of something...

    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"

  18. Connect-and-Exchange commented on Oct 24, 2025

    @Connect-and-Exchange

    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')

  19. kubaflo commented on Oct 18, 2026

    @kubaflo
    Contributor

    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.

  20. locked and limited conversation to collaborators on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-single-projectplatform/ios

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions