Repository navigation
Description
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.csprojreferencesUno.WinUI.Graphics3DGLandSilk.NET.OpenGLwithPrivateAssets="all"(41b8739). This is intentional per the comment ("when the island is actually used, Graphics3DGL brings Silk along").build/nuget/Uno.WinUI.Graphics2DSK.nuspecdeclares onlyUno.WinUIandSkiaSharp.
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) 🔬
- Use an Uno Platform app with an Android target on
Uno.Sdk.Private7.0.0-dev.1166(7.0.0-dev.1192behaves the same), with no explicitUno.WinUI.Graphics3DGLreference and default Release AOT settings. - Run
dotnet build -c Release -f net10.0-android. - 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:
- passing on
7.0.0-dev.980: https://dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_build/results?buildId=235352&view=results - failing on
7.0.0-dev.1166: https://dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_build/results?buildId=235400&view=results - failing on
7.0.0-dev.1192: https://dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_build/results?buildId=235593&view=results
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.Private7.0.0-dev.1166and7.0.0-dev.1192; last good7.0.0-dev.980Microsoft.Android.Sdk.Windows36.1.2, .NET SDK10.0.101- iOS:
Uno.WinUI7.0.0-dev.1215, .NET SDK11.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
[-]Android AOT fails: Graphics2DSK missing Graphics3DGL dependency[/-][+]Android AOT and net11 iOS builds fail: Graphics2DSK missing Graphics3DGL dependency[/+]MartinZikmund commentedon Sep 27, 2026
@ramezgerges not sure what is the right fix to this one, but the dependency on 3D is odd
ci: Reference Graphics3DGL from net11 iOS heads during validation
fix(2dsk): Stop referencing Graphics3DGL from Graphics2DSK
test(2dsk): Guard Graphics2DSK against referencing Graphics3DGL
fix(2dsk): Stop referencing Graphics3DGL from Graphics2DSK
test(2dsk): Guard Graphics2DSK against referencing Graphics3DGL
fix(build): Reference Graphics3DGL from the Android sample heads
chore: Retarget to Uno 7.0.0-dev.1574