Skip to content

Android + NativeAOT runtime tests abort with a null xamlRoot after the SamplesApp head consolidation #24352

Open

Description

@MartinZikmund

Current behavior 🐛

Every Android + NativeAOT runtime-test group on feature/breakingchanges aborts immediately after the SamplesApp head consolidation (#24046). Each of the five groups produces two NUnit results instead of ~1500, one of them the harness' synthetic Runtime exception:

System.ArgumentNullException: Value cannot be null. (Parameter 'xamlRoot')
   at Microsoft.UI.Xaml.Media.VisualTreeHelper.GetOpenPopupsForXamlRoot(XamlRoot xamlRoot)
   at Uno.UI.Samples.Tests.UnitTestsControl.CloseRemainingPopups()
   at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass74_0.<ExecuteTestsForInstance>b__16()
   ...
   at Uno.UI.Samples.Tests.UnitTestsControl.<RunTests>d__72.MoveNext()

UnitTestsControl.OnLoaded is what publishes TestServices.WindowHelper.XamlRoot; it never runs, so the first test's general cleanup throws and the whole run is abandoned.

Tests - Android Skia (Mono, same head, same commit) passes with 1242–1475 results in the same CI run, so the delta is the trimmed/AOT publish, not the code.

Expected behavior 🎯

The Android + NativeAOT runtime tests run the full group, as they did on the previous commit (1472 / 2360 / 1831 results, 0 failures).

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

dotnet publish src/SamplesApp/SamplesApp/SamplesApp.csproj -c Release -r android-x64 \
  -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android \
  -p:SkiaPublishAot=true -p:SkiaSharpVersion=4.151.1

then run the resulting APK through build/test-scripts/android-run-skia-runtime-tests.sh.

Workaround 🛠️

Root the head assembly for the trimmer on android: <TrimmerRootAssembly Include="SamplesApp" RootMode="All" />.

Renderer 🎨

Skia

Affected platforms 📱💻🖥️

Android (Skia + NativeAOT)

Uno.Sdk version (and other relevant versions) 📦

feature/breakingchanges @ 6dfcb8f (7.0-dev), .NET 11.0.100-preview.7

Anything else we need to know? 💬

Root cause: the removed SamplesApp.Skia.netcoremobile head rooted the samples assembly with TrimmerRootAssembly RootMode="All" on every one of its targets. The consolidated head restored that only for iOS/tvOS. Android+NativeAOT publishes with PublishTrimmed=true / TrimMode=full and has no managed entry point to root the app assembly from, so the samples and the runtime-test harness — both reached only by reflection — are trimmed out of the head. Confirmed by diffing the TrimmerRootAssembly items in the CI build binlogs before and after the consolidation.

Secondary gap: the Tests - Android+NativeAOT Skia stage is gated on ne(variables['Build.Reason'], 'PullRequest'), so no PR ever exercises it and the regression could only appear post-merge.

Activity

  1. added
    kind/bug
    platform/android 🤖
    area/skia ✏️
    on Sep 2, 2026
  2. self-assigned this
    on Sep 2, 2026
  3. added
    7.0
    on Oct 14, 2026
  4. removed
    7.0
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/skia ✏️kind/bugplatform/android 🤖

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions