Skip to content

Uno.Sdk 7.0 compiles a leftover Platforms/MacCatalyst folder into every head except Desktop #24870

Closed

Description

@MartinZikmund

Current behavior 🐛

The Mac Catalyst removal in 7.0 (#23772) dropped MacCatalystProjectFolder / MacOSProjectFolder from the platform ignore list in Uno.Common.targets. A project that still has a Platforms/MacCatalyst/ folder (templates created before 7.0 include one) now gets those files compiled into every head except net*-desktop, so unrelated heads fail with errors such as:

Platforms/MacCatalyst/Main.maccatalyst.cs(1,7): error CS0246: The type or namespace name 'UIKit' could not be found
  [TargetFramework=net10.0-browserwasm]

I confirmed on the Uno.Sdk evaluation (-getItem:Compile, no build needed) that Platforms/MacCatalyst/Main.maccatalyst.cs is in Compile for net10.0-browserwasm and net10.0-android, while Platforms/Android/Main.cs is correctly removed from net10.0-browserwasm. net10.0-desktop is not affected because Uno.SingleProject.Desktop.targets removes every Platforms/* folder except Desktop.

The 7.0 migration guide (doc/articles/migrating-to-uno-7.md, "Mac Catalyst is removed") says "the Platforms/MacCatalyst/ folder is no longer picked up". In practice the opposite happens: it is picked up by the default glob and nothing excludes it. The only hint to delete the folder is the last line of the migration checklist, and the build error does not point there.

Expected behavior 🎯

One of these (in order of preference):

  1. Keep ignoring Platforms/MacCatalyst/** (and Platforms/macOS/**) for all heads, as 6.x did, so an old folder is inert.
  2. Emit a clear diagnostic when Platforms/MacCatalyst/ exists (or a net*-maccatalyst TFM is listed) saying Mac Catalyst is no longer supported and the folder should be removed or moved to Platforms/Desktop/.

At minimum the migration guide wording should be corrected: the folder is not ignored any more, so it must be deleted or moved.

How to reproduce it (as minimally and precisely as possible) 🔬

  1. Create a folder with global.json:
    { "msbuild-sdks": { "Uno.Sdk": "7.0.0-dev.32" } }
  2. Add MacCatProbe.csproj:
    <Project Sdk="Uno.Sdk">
    	<PropertyGroup>
    		<TargetFrameworks>net10.0-desktop;net10.0-browserwasm;net10.0-android</TargetFrameworks>
    		<OutputType>Exe</OutputType>
    		<UnoSingleProject>true</UnoSingleProject>
    		<UnoFeatures></UnoFeatures>
    	</PropertyGroup>
    </Project>
  3. Add Platforms/MacCatalyst/Main.maccatalyst.cs:
    using UIKit;
    
    class MainMac { }
    and Platforms/Android/Main.cs containing class AndroidOnly { } as a control.
  4. Run:
    dotnet msbuild -p:TargetFramework=net10.0-browserwasm -getItem:Compile
    dotnet msbuild -p:TargetFramework=net10.0-android -getItem:Compile
    dotnet msbuild -p:TargetFramework=net10.0-desktop -getItem:Compile
    
  5. Result: Platforms\MacCatalyst\Main.maccatalyst.cs is listed for browserwasm and android (and would be for ios, tvos, windows). Platforms\Android\Main.cs is not listed for browserwasm. Building net10.0-browserwasm fails with CS0246 on UIKit.
  6. Control: the same project on Uno.Sdk 6.7.30 (with net9.0-* TFMs) does not list the MacCatalyst file for browserwasm or android.

Workaround 🛠️

Delete (or move to Platforms/Desktop/) the Platforms/MacCatalyst/ folder, or exclude it explicitly:

<ItemGroup>
	<Compile Remove="Platforms\MacCatalyst\**" />
	<None Include="Platforms\MacCatalyst\**" />
</ItemGroup>

Renderer 🎨

  • Skia

Affected platforms 📱💻🖥️

WebAssembly, Android, iOS, Windows App SDK, Build tasks

Uno.Sdk version (and other relevant versions) 📦

Uno.Sdk 7.0.0-dev.32 (verified), and the 7.0.0-dev.1166 Uno.Sdk.Private build has the same ignore list as current master (47267e7). .NET SDK 10.0.4xx.

IDE version 🧑‍💻

N/A (command line)

Anything else we need to know? 💬

Root cause: the list of ignored platform folders in src/Uno.Sdk/targets/Uno.Common.targets now covers Android, iOS, tvOS, Desktop, Wasm and Windows only. Uno.Sdk 6.x also had MacCatalystProjectFolder and MacOSProjectFolder entries there. src/Uno.Sdk/targets and Sdk no longer contain any reference to MacCatalyst.

A small fix is to add one generic _IgnorePlatformFiles item for $(PlatformsProjectFolder)MacCatalyst\** and macOS\** (unconditionally, since no head uses them), or a build warning when those folders exist.

Related but distinct: #24500 (the SDK silently accepts a net10.0-maccatalyst TFM). That one is about the TFM being accepted without any diagnostic; this one is about the leftover source folder being compiled into other heads. A single "Mac Catalyst is not supported" diagnostic could cover both.

Activity

  1. added
    kind/bug
    good first issue
    platform/macos 🍏
    triage/untriaged
    difficulty/starter 🚀
    area/sdk
    on Oct 1, 2026
  2. added
    7.0
    on Oct 14, 2026
  3. removed
    triage/untriaged
    7.0
    on Oct 29, 2026
  4. self-assigned this
    on Oct 29, 2026
  5. added a commit that references this issue on Nov 2, 2026
    7073fa4
  6. khaskoul commented on Nov 9, 2026

    @khaskoul

    Scope: Windows head. App with -platforms desktop windows plus Platforms/MacCatalyst/Main.maccatalyst.cs (using UIKit; class M {}).

    Build -getItem:Compile for net10.0-windows10.0.26100 Debug build of that TFM
    dev.89 includes Platforms\MacCatalyst\Main.maccatalyst.cs error CS0246 (UIKit not found)
    dev.179 App.xaml.cs, GlobalUsings.cs, MainPage.xaml.cs only exit 0, 0 errors, warning UNOB0033 ("Platforms\MacCatalyst\ folder is not built ...") plus the usual NETSDK1198

    Result: fixed (checked on the Windows head; the browserwasm / android heads from the report were not built).

    Verified fixed on Uno.Sdk 7.0.0-dev.179.

    Environment: Windows 11 Pro (26200), .NET SDK 10.0.401, Uno.Sdk / Uno.Templates 7.0.0-dev.179 (Uno.WinUI 7.1.0-dev.90).

    App created with -platforms desktop windows plus Platforms/MacCatalyst/Main.maccatalyst.cs (using UIKit; class M {}), checked on the WinAppSDK head (net10.0-windows10.0.26100):

    Build dotnet msbuild -getItem:Compile Debug build
    Uno.Sdk 7.0.0-dev.89 contains Platforms\MacCatalyst\Main.maccatalyst.cs error CS0246: 'UIKit' could not be found
    Uno.Sdk 7.0.0-dev.179 App.xaml.cs, GlobalUsings.cs, MainPage.xaml.cs (no MacCatalyst file) exit 0, 0 errors; warning UNOB0033 "The 'Platforms\MacCatalyst' folder is not built: Mac Catalyst was removed in Uno Platform 7.0 ..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/sdkdifficulty/starter 🚀good first issuekind/bugkind/documentationplatform/macos 🍏

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions