Skip to content

Android AOT and net11 iOS builds fail: Graphics2DSK missing Graphics3DGL dependency #24699

Closed
unoplatform/Uno.Themes
#1749

Description

@rajamatt

Current behavior 🐛

Since 7.0.0-dev.1166, Android Release builds fail during AOT on Uno.WinUI.Graphics2DSK.dll unless the app also references Uno.WinUI.Graphics3DGL:

Microsoft.Android.Sdk.Aot.targets(123,5): error : Precompiling failed for ...\obj\Release\net10.0-android\android-arm64\linked\Uno.WinUI.Graphics2DSK.dll with exit code 1.
Microsoft.Android.Sdk.Aot.targets(123,5): error : Failed to load method 0x6000014 from '...\linked\Uno.WinUI.Graphics2DSK.dll' due to Could not load file or assembly 'Uno.WinUI.Graphics3DGL, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' or one of its dependencies..

The same error appears for android-x64. Method 0x06000014 is Uno.WinUI.Graphics2DSK.SkiaGLCanvasElement::.ctor.

Apps don't opt into this. Uno.Implicit.Packages.ProjectSystem.targets references Uno.WinUI.Graphics2DSK implicitly in every app.

Cause: the GL-island fallback from b6b81f2 (via #24153) gives Graphics2DSK a type-level dependency on Graphics3DGL (internal sealed class SkiaGLCanvasElement : GLCanvasElement). The package doesn't carry that dependency:

  • src/AddIns/Uno.WinUI.Graphics2DSK/Uno.WinUI.Graphics2DSK.Crossruntime.csproj references Uno.WinUI.Graphics3DGL and Silk.NET.OpenGL with PrivateAssets="all" (41b8739). This is intentional per the comment ("when the island is actually used, Graphics3DGL brings Silk along").
  • build/nuget/Uno.WinUI.Graphics2DSK.nuspec declares only Uno.WinUI and SkiaSharp.

JIT targets can load that type lazily. Mono AOT compiles it and cannot resolve the base type.

Assembly references of lib/net10.0/Uno.WinUI.Graphics2DSK.dll:

7.0.0-dev.980 7.0.0-dev.1166
System.Runtime, Uno.UI, Uno.UI.Composition, SkiaSharp, Uno.Foundation the same, plus Uno.WinUI.Graphics3DGL, Silk.NET.OpenGL, Uno.UI.Composition.Drawing, Uno.UI.Dispatching, System.Numerics.Vectors, Uno.Core.Extensions.Logging.Singleton, Microsoft.Extensions.Logging.Abstractions

iOS (.NET 11): every default app fails its net11.0-ios build. The .NET 11 macios linker's CoreTypeMap step resolves every assembly reference eagerly, so it fails even in Debug:

error MT2390: The linker step 'CoreTypeMap' failed while processing Uno.WinUI.Graphics2DSK, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null: Unable to resolve the assembly reference Uno.WinUI.Graphics3DGL, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null

The same apps build for net10.0-ios. Seen on all 8 apps of the macOS net11 group in the uno.templates validation for unoplatform/uno.templates#2281 (Uno.WinUI 7.0.0-dev.1215, .NET SDK 11.0.100-rc.1.26425.128, Xcode 26.5): https://github.com/unoplatform/uno.templates/actions/runs/36304083894

The Uno.Sdk only adds Uno.WinUI.Graphics3DGL implicitly for Desktop and WinAppSDK heads, so it is absent on every mobile head.

Expected behavior 🎯

A default app builds for Android Release and for net11.0-ios with no extra package reference. Either Uno.WinUI.Graphics2DSK declares its Uno.WinUI.Graphics3DGL dependency, or Graphics2DSK.dll no longer contains a type whose base type lives in an assembly the package doesn't bring.

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

  1. Use an Uno Platform app with an Android target on Uno.Sdk.Private 7.0.0-dev.1166 (7.0.0-dev.1192 behaves the same), with no explicit Uno.WinUI.Graphics3DGL reference and default Release AOT settings.
  2. Run dotnet build -c Release -f net10.0-android.
  3. The AOT step fails as shown above.

iOS: dotnet new unoapp -tfm net11.0 on a 7.0 Uno.Sdk, then dotnet build -f net11.0-ios with the .NET 11 RC1 SDK and Xcode 26.5.

Seen on the three Android sample heads in Uno.Themes (Simple, Material, Cupertino). None of them references Graphics2DSK or Graphics3DGL directly. I haven't reduced this to a blank template yet.

Uno.Themes canary builds. The branch, master and every other package version are the same in both; only Uno.Sdk.Private changed:

Workaround 🛠️

Untested: add an explicit <PackageReference Include="Uno.WinUI.Graphics3DGL" /> to the app head.

Renderer 🎨

Skia

Affected platforms 📱💻🖥️

Android, iOS

Uno.Sdk version (and other relevant versions) 📦

  • Uno.Sdk.Private 7.0.0-dev.1166 and 7.0.0-dev.1192; last good 7.0.0-dev.980
  • Microsoft.Android.Sdk.Windows 36.1.2, .NET SDK 10.0.101
  • iOS: Uno.WinUI 7.0.0-dev.1215, .NET SDK 11.0.100-rc.1.26425.128, Xcode 26.5

IDE version 🧑‍💻

N/A (CI, Azure Pipelines Windows agent)

Anything else we need to know? 💬

The same SDK bump also breaks desktop startup, but through a different cause: #24153 brings back the implicit SkiaSharp.Views.Uno.WinUI reference. That part is covered in #24460.

Activity

  1. added
    triage/untriaged
    on Sep 25, 2026
  2. changed the title [-]Android AOT fails: Graphics2DSK missing Graphics3DGL dependency[/-] [+]Android AOT and net11 iOS builds fail: Graphics2DSK missing Graphics3DGL dependency[/+] on Sep 27, 2026
  3. added
    platform/ios 🍎
    platform/android 🤖
    on Sep 27, 2026
  4. MartinZikmund commented on Sep 27, 2026

    @MartinZikmund
    Member

    @ramezgerges not sure what is the right fix to this one, but the dependency on 3D is odd

  5. added a commit that references this issue on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

platform/android 🤖platform/ios 🍎triage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions