Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jonpryor
Copy link
Contributor

Context: #21256

#21256 added support for building with .NET 10, and one of the new features in .NET 10 is that Android has (very!) preliminary preview support for NativeAOT.

As building SamplesApp.Skia.netcoremobile.csproj with NativeAOT takes a significant amount of time, we've decided to introduce a new stage to build and run these new unit tests.

Initially, though, this PR won't build for NativeAOT. This is to ensure that the various build artifacts are built in the expected locations. Once the non-NativeAOT build works, we'll enable it.

Update Main.Android.cs so that Debuggable is always true. NativeAOT can only be used with Release configuration builds, so this is necessary to "poking around" the installation directory.

Update DeviceTargetHelper.cs: the current Android+NativeAOT support is built atop Linux support, to the extent that
OperatingSystem.IsLinux() is true! Extend the platform detection logic so that the app can startup, avoiding an assertion:

I NativeAotFromAndroid: App failed to initialize: Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.IsTrue failed. /data/user/0/uno.platform.samplesapp.skia/files does not contain Uno Platform
I NativeAotFromAndroid:    at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ThrowAssertFailed(String, String) + 0x6e
I NativeAotFromAndroid:    at SamplesApp.App.<AssertApplicationData>g__AssertContainsIdProps|32_2(StorageFolder, App.<>c__DisplayClass32_0&) + 0x16a
I NativeAotFromAndroid:    at SamplesApp.App.AssertApplicationData() + 0xb4
I NativeAotFromAndroid:    at SamplesApp.App..ctor() + 0x2a3
I NativeAotFromAndroid:    at SamplesApp.Droid.Application.<>c.<.ctor>b__0_0() + 0x18
I NativeAotFromAndroid:    at Microsoft.UI.Xaml.NativeApplication.<OnActivityStarted>b__7_0() + 0x12
I NativeAotFromAndroid:    at Uno.UI.Runtime.Skia.Android.AndroidHost.<Run>g__CreateApp|2_10(ApplicationInitializationCallbackParams _) + 0xf
I NativeAotFromAndroid:    at Microsoft.UI.Xaml.Application.StartPartial(ApplicationInitializationCallback callback) + 0xb5
I NativeAotFromAndroid:    at Uno.UI.Runtime.Skia.Android.AndroidHost.Run() + 0x306

Update ApplicationData.GetRoamingFolder() to explicitly create Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData). (Apparently this isn't created by default under NativeAOT?) This avoids a startup assertion:

I NativeAotFromAndroid: App failed to initialize: System.IO.DirectoryNotFoundException: IO_PathNotFound_Path, /data/user/0/uno.platform.samplesapp.skia/files/.config/b63c4306-f361-42d0-bc1d-5be385a95c78.txt
I NativeAotFromAndroid:    at System.IO.FileSystem.DeleteFile(String) + 0xe7
I NativeAotFromAndroid:    at SamplesApp.App.<AssertApplicationData>g__AssertCanCreateFile|32_3(StorageFolder) + 0x10c
I NativeAotFromAndroid:    at SamplesApp.App.AssertApplicationData() + 0xa5
I NativeAotFromAndroid:    at SamplesApp.App..ctor() + 0x2a3
I NativeAotFromAndroid:    at SamplesApp.Droid.Application.<>c.<.ctor>b__0_0() + 0x18
I NativeAotFromAndroid:    at Microsoft.UI.Xaml.NativeApplication.<OnActivityStarted>b__7_0() + 0x12
I NativeAotFromAndroid:    at Uno.UI.Runtime.Skia.Android.AndroidHost.<Run>g__CreateApp|2_10(ApplicationInitializationCallbackParams _) + 0xf
I NativeAotFromAndroid:    at Microsoft.UI.Xaml.Application.StartPartial(ApplicationInitializationCallback callback) + 0xb5
I NativeAotFromAndroid:    at Uno.UI.Runtime.Skia.Android.AndroidHost.Run() + 0x306

TODO:

  • Enable NativeAOT builds by uncommenting the $(SkiaPublishAot) MSBuild property within SamplesApp.Skia.netcoremobile.csproj.

GitHub Issue: closes #

PR Type:

What is the current behavior? 🤔

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

@github-actions github-actions bot added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform area/automation Categorizes an issue or PR as relevant to project automation labels Aug 27, 2025
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@jonpryor
Copy link
Contributor Author

There's going to be another SNAFU with this idea: dotnet/java-interop@90ac202

.NET 10 Previews 2 through 7 have a bug in .NET for Android wherein the app crashes when attempting to use boolean fields. As this PR builds SamplesApp.Skia.netcoremobile against net10.0-android, it thus encounters this behavior and crashes; from android-device-log-RuntimeTests-0-RuntimeTests.interim.txt:

F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
F DEBUG   : Build fingerprint: 'google/sdk_gphone64_x86_64/emu64xa:14/UE1A.230829.036.A4/12096271:user/release-keys'
F DEBUG   : Revision: '0'
F DEBUG   : ABI: 'x86_64'
F DEBUG   : Timestamp: 2025-08-27 20:06:55.197697199+0000
F DEBUG   : Process uptime: 351s
F DEBUG   : Cmdline: uno.platform.samplesapp.skia
F DEBUG   : pid: 4518, tid: 4518, name: samplesapp.skia  >>> uno.platform.samplesapp.skia <<<
F DEBUG   : uid: 10190
F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
F DEBUG   : Abort message: 'JNI DETECTED ERROR IN APPLICATION: attempt to access field boolean android.widget.RelativeLayout$LayoutParams.alignWithParent of type boolean with the wrong type byte: 0x77
F DEBUG   :     in call to SetByteField
F DEBUG   :     from void mono.java.lang.NativeDispatcherImplementor.n_run()'
F DEBUG   :     rax 0000000000000000  rbx 00007ffe9831c418  rcx 000072d75ab19610  rdx 0000000000000006
F DEBUG   :     r8  000072d6c8633e91  r9  000072d6c8633e91  r10 00007ffe9831c420  r11 0000000000000203
F DEBUG   :     r12 000072d688675cb0  r13 00007ffe9831c608  r14 00000000000011a6  r15 00000000000011a6
F DEBUG   :     rdi 00000000000011a6  rsi 00000000000011a6
F DEBUG   :     rbp 0000000000000000  rsp 00007ffe9831c410  rip 000072d75ab19610
F DEBUG   : 11 total frames
F DEBUG   : backtrace:
F DEBUG   :       #00 pc 0000000000061610  /apex/com.android.runtime/lib64/bionic/libc.so (abort+192) (BuildId: fa337969c798946280caa45e2d71a2e7)
F DEBUG   :       #01 pc 00000000007fabab  /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+1627) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
F DEBUG   :       #02 pc 0000000000037abd  /apex/com.google.mainline.primary.libs@340724000/lib64/libbase.so/a5cce001552a532d111a59af51bbb6cc5e93475522f033f9807fa5f8ad346840deb8c6475491b3425ed7ef34094fb412761afd70b2205820f67d8a4c71c39832/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_0::__invoke(char const*)+61) (BuildId: d848a07685150bc1df3af6b95e4bc316)
F DEBUG   :       #03 pc 0000000000036fe2  /apex/com.google.mainline.primary.libs@340724000/lib64/libbase.so/a5cce001552a532d111a59af51bbb6cc5e93475522f033f9807fa5f8ad346840deb8c6475491b3425ed7ef34094fb412761afd70b2205820f67d8a4c71c39832/libbase.so (android::base::LogMessage::~LogMessage()+354) (BuildId: d848a07685150bc1df3af6b95e4bc316)
F DEBUG   :       #04 pc 00000000005ed357  /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+2695) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
F DEBUG   :       #05 pc 00000000005ed3c5  /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, __va_list_tag*)+85) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
F DEBUG   :       #06 pc 00000000005de0af  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::AbortF(char const*, ...) (.__uniq.99033978352804627313491551960229047428)+191) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
F DEBUG   :       #07 pc 00000000005e40bd  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::CheckFieldAccess(art::ScopedObjectAccess&, _jobject*, _jfieldID*, bool, art::Primitive::Type) (.__uniq.99033978352804627313491551960229047428)+2301) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
F DEBUG   :       #08 pc 00000000005e4caf  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::SetField(char const*, _JNIEnv*, _jobject*, _jfieldID*, bool, art::Primitive::Type, art::(anonymous namespace)::JniValueType) (.__uniq.99033978352804627313491551960229047428)+863) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
F DEBUG   :       #09 pc 00000000005cf197  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::SetByteField(_JNIEnv*, _jobject*, _jfieldID*, signed char) (.__uniq.99033978352804627313491551960229047428.llvm.1924743731234850023)+39) (BuildId: b6dc79e02101ea00827a35a55ab6597a)
F DEBUG   :       #10 pc 0000000000e71155  <anonymous:64797000>

(I had forgotten encountering this crash, but the crash is why I fixed the java-interop bug two weeks ago…)

Immediate-term, I'll build SamplesApp.Skia.netcoremobile as a net9 app, just to verify that artifact name/etc. behavior works as expected.

Longer-term, we either wait for the next September .NET 10 Preview release -- which should have the fix for this abort -- or we alter SamplesApp.Skia.netcoremobile to avoid hitting RelativeLayout.LayoutParams.alignWithParent.

I'm partial to the latter, as it will speed things up.

@unodevops
Copy link
Contributor

⚠️⚠️ The build 174635 has failed on Uno.UI - CI.

@jonpryor jonpryor force-pushed the dev/jonpryor/jonp-add-android+nativeaot-skia-sample-stage branch from 14dd13a to 6b0649f Compare August 28, 2025 16:32
@github-actions github-actions bot added area/build Categorizes an issue or PR as relevant to build infrastructure and removed platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform area/automation Categorizes an issue or PR as relevant to project automation labels Aug 28, 2025
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@github-actions github-actions bot added the platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform label Aug 28, 2025
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@github-actions github-actions bot added the area/automation Categorizes an issue or PR as relevant to project automation label Aug 28, 2025
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@jonpryor
Copy link
Contributor Author

"Interestingly", the crash noted above? It's caused by making the app Debuggable! This patch:

diff --git a/src/SamplesApp/SamplesApp.Skia.netcoremobile/Android/Main.Android.cs b/src/SamplesApp/SamplesApp.Skia.netcoremobile/Android/Main.Android.cs
index 79e647c76c..c3601f89f6 100644
--- a/src/SamplesApp/SamplesApp.Skia.netcoremobile/Android/Main.Android.cs
+++ b/src/SamplesApp/SamplesApp.Skia.netcoremobile/Android/Main.Android.cs
@@ -40,6 +40,7 @@ using Uno.UI;
 namespace SamplesApp.Droid
 {
 	[global::Android.App.ApplicationAttribute(
+		Debuggable = true,
 		Label = "@string/SamplesAppName",
 		Icon = "@mipmap/icon",
 		Banner = "@drawable/banner",

breaks both Tests - Android Skia and the (currently nearly identical) Tests - Android+NativeAOT Skia.

Offhand, I'm not sure why that would happen…but this does explain my confusion yesterday around why both Tests - Android Skia and Tests - Android+NativeAOT Skia would be crashing in the same way when running different binaries!

TIL, and I'm still confuzzled.

@unodevops
Copy link
Contributor

⚠️⚠️ The build 174734 has failed on Uno.UI - CI.

@jonpryor jonpryor force-pushed the dev/jonpryor/jonp-add-android+nativeaot-skia-sample-stage branch from 22ef026 to d937156 Compare August 29, 2025 00:24
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@nventive-devops
Copy link
Contributor

The build 174741 found UI Test snapshots differences: android-28-net9: 21, android-28-net9-Snap: 36, ios: 6, ios-Snap: 52, skia-linux-screenshots: 68, skia-windows-screenshots: 659, wasm: 47, wasm-automated-net9.0-WinUI-Benchmarks-automated: 0, wasm-automated-net9.0-WinUI-Default-automated: 0, wasm-automated-net9.0-WinUI-RuntimeTests-0: 0, wasm-automated-net9.0-WinUI-RuntimeTests-1: 0, wasm-automated-net9.0-WinUI-RuntimeTests-2: 0, wasm-automated-net10.0-WinUI-Benchmarks-automated: 0, wasm-automated-net10.0-WinUI-Default-automated: 13, wasm-automated-net10.0-WinUI-RuntimeTests-0: 0, wasm-automated-net10.0-WinUI-RuntimeTests-1: 0, wasm-automated-net10.0-WinUI-RuntimeTests-2: 0

Details
  • android-28-net9: 21 changed over 825

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DecimalFormatterTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • FlyoutTest_When_NoOverlayInputPassThroughElement_Then_DontPassThrough_woAuto_UITests_Shared_Windows_UI_Xaml_Controls_Flyout_Flyout_OverlayInputPassThroughElement
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • WebView_NavigateToAnchor_Initial
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Detereminate_ProgressRing_Validation75_[#FF0000_#008000_#008000_#008000]_Progress-Ring-Value-75
    • UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • Detereminate_ProgressRing_Validation0_[#FF0000_#FF0000_#FF0000_#FF0000]_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIDeterminateProgressRing
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • Popup_PlacementTest_2Default_HTVL_Uno_UI_Samples_Content_UITests_Popup_Popup_HVAlignments
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25
    • NativeCommandBar_Size_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Dynamic
    • Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50
    • When_Parent_PointerMoved_After_drag_on_non-scrolling_ScrollViewer
  • android-28-net9-Snap: 36 changed over 1073

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • ListView_ListView_With_ListViews_Count_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • TabView_MUXControlsTestApp_TabViewPage_MUXControlsTestApp_TabViewPage
    • TeachingTip_UITests_Microsoft_UI_Xaml_Controls_TeachingTipTests_TeachingTipPage_UITests_Microsoft_UI_Xaml_Controls_TeachingTipTests_TeachingTipPage
    • Gesture_Recognizer_Pointer_Events_test_bench_UITests_Shared_Windows_UI_Input_GestureRecognizer_PointersEvents
    • NavigationView_MUXControlsTestApp_NavigationViewTopNavPage_MUXControlsTestApp_NavigationViewTopNavPage
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Basic_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Basic
    • MUX_NumberBox_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • CommandBar_Examples_Uno_UI_Samples_Content_UITests_CommandBar_CommandBar_Examples
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • Scrolling_MUXControlsTestApp_ScrollViewDynamicPage_MUXControlsTestApp_ScrollViewDynamicPage
    • Scrolling_MUXControlsTestApp_ScrollViewKeyboardAndGamepadNavigationPage_MUXControlsTestApp_ScrollViewKeyboardAndGamepadNavigationPage
    • Pickers_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • SwipeControl_MUXControlsTestApp_SwipeControlPage2_MUXControlsTestApp_SwipeControlPage2
    • CommandBarFlyout_MUXControlsTestApp_CommandBarFlyoutPage_MUXControlsTestApp_CommandBarFlyoutPage
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • NavigationView_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage_MUXControlsTestApp_NavigationViewCustomThemeResourcesPage
    • Transform_Basics_UITests_Shared_Windows_UI_Xaml_Media_Transform_Basics
    • ListView_HorizontalListView_Padding_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListView_Padding
    • UIElement_TransformToVisual_Simple_UITests_Shared_Windows_UI_Xaml_UIElementTests_TransformToVisual_Simple
  • ios: 6 changed over 255

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • ImageStretch_None_Uno_UI_Samples_UITests_ImageTestsControl_Image_Stretch_None
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
  • ios-Snap: 52 changed over 990

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Brushes_ImageBrushLocalAsset_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushLocalAsset
    • Brushes_EllipsemaskingEllipseGrid_Uno_UI_Samples_UITests_ImageBrushTestControl_EllipsemaskingEllipseGrid
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Smaller
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Taller_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Taller
    • Popup_MessageDialog_UITests_Shared_Windows_UI_Xaml_Controls_Popup_MessageDialog
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
    • Buttons_Custom_Button_With_ContentTemplate_Uno_UI_Samples_Content_UITests_ButtonTestsControl_Custom_Button_With_ContentTemplate
    • ContentControl_ContentControl_SelectorInheritance_Uno_UI_Samples_Content_UITests_ContentControlTestsControl_ContentControl_SelectorInheritance
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Uno_UI_Samples_UITests_Image_Image_Stretch
    • Grid_Grid_DataBound_ColumnRow_Definitions_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_DataBound_ColumnRow_Definitions
    • NavigationView_MUXControlsTestApp_NavigationViewMenuItemStretchPage_MUXControlsTestApp_NavigationViewMenuItemStretchPage
    • NavigationView_MUXControlsTestApp_NavigationViewMinimalPage_MUXControlsTestApp_NavigationViewMinimalPage
    • NavigationView_MUXControlsTestApp_NavigationViewRS3Page_MUXControlsTestApp_NavigationViewRS3Page
    • NavigationView_MUXControlsTestApp_NavigationViewRS4Page_MUXControlsTestApp_NavigationViewRS4Page
    • Pickers_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • Brushes_BorderImageBrush_Uno_UI_Samples_UITests_ImageBrushTestControl_BorderImageBrush
    • Microsoft_UI_Xaml_Media_UITests_Windows_UI_Xaml_Media_ThemeShadowTests_ThemeShadow_Overlap_UITests_Windows_UI_Xaml_Media_ThemeShadowTests_ThemeShadow_Overlap
    • Grid_CenteredGridinGridwiththreefixedsizechildren_Uno_UI_Samples_Content_UITests_GridTestsControl_CenteredGridinGridwiththreefixedsizechildren
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats_UITests_Windows_UI_Xaml_Controls_ImageTests_Image_Formats
  • skia-linux-screenshots: 68 changed over 2286

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ButtonClippingTestsControl.png-dark
    • DisplayInformation.png-dark
    • Examples.png-dark
    • Examples.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • CalendarView_Theming.png
    • ImageBrush_Formats.png-dark
    • ImageBrush_Formats.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ImagesInlineInFlipView.png-dark
  • skia-windows-screenshots: 659 changed over 2286

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedIconPage.png
    • AppBarButtonWithIconTest.png-dark
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewSizing.png
    • AppWindowClosing.png-dark
    • AppWindowPresenters.png
    • Arrange_Performance01.png-dark
    • Arrange_Performance01.png
    • AutoSizedTopLeft.png-dark
    • AutoSizedTopLeft.png
    • Border_With_Off_Centre_ScaleTransform.png
    • Border_With_RotateTransform.png-dark
    • Border_With_RotateTransform.png
    • Border_With_ScaleTransform.png-dark
    • ContentDialog_Simple.png-dark
    • ContentDialog_Simple.png
    • ContentPresenter_Background.png-dark
    • ContentPresenter_Background.png
    • DoubleAnimation_Opacity_TextBlock.png-dark
    • DoubleAnimation_Opacity_TextBlock.png
  • wasm: 47 changed over 1055

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • GenericApp.Views.Samples.Shared.Content.UITests.GridViewMultipleSelectionMode
    • SamplesApp.Samples.Windows_UI_Xaml_Controls.NavigationViewTests.NavigationView_BasicNavigation
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • Uno.UI.Samples.Content.UITests.FocusTests.FocusManagerTest
    • UITests.Shared.Windows_UI_Xaml_Controls.ContentDialogTests.ContentDialog_Simple
    • UITests.Windows_UI_Xaml.FrameworkElementTests.FrameworkElement_Sizes
    • UITests.Windows_UI_Xaml_Controls.ListView.ListView_Selection_Events
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ComboBox.ComboBox_DropDownWidth
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_Inside_ListView
    • UITests.Shared.Windows_UI_Input.GestureRecognizer.PointersEvents
    • UITests.Shared.Windows_UI_Xaml_Controls.ComboBox.ComboBox_MaxDropdownHeight
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_Expandable_Item
    • UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_Weird_Measure
    • UITests.Windows_UI_Xaml_Controls.ListView.ListViewItem_IsEnabled
    • UITests.Windows_UI_Xaml_Media_Animation.DoubleAnimation_FinalState_Opacity
    • UITests.Windows_UI_Xaml_Media_Animation.DoubleAnimation_FinalState_Transforms
    • MUXControlsTestApp.SwipeControlPage2
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_ItemContainerStyleSelector
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListView_Image
  • wasm-automated-net9.0-WinUI-Benchmarks-automated: 0 changed over 1

  • wasm-automated-net9.0-WinUI-Default-automated: 0 changed over 877

  • wasm-automated-net9.0-WinUI-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-2: 0 changed over 1

  • wasm-automated-net10.0-WinUI-Benchmarks-automated: 0 changed over 1

  • wasm-automated-net10.0-WinUI-Default-automated: 13 changed over 877

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Default_StrokeThickness_MyPolygon
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Default_StrokeThickness_MyEllipse
    • Default_StrokeThickness_MyRect
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • Default_StrokeThickness_MyPolyline
    • Default_StrokeThickness_MyLine
    • When_Theme_Changed_No_Crash_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
    • Default_StrokeThickness_MyPath
    • When_NoSelection_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
  • wasm-automated-net10.0-WinUI-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net10.0-WinUI-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net10.0-WinUI-RuntimeTests-2: 0 changed over 1

@unodevops
Copy link
Contributor

⚠️⚠️ The build 174741 has failed on Uno.UI - CI.

@jonpryor jonpryor force-pushed the dev/jonpryor/jonp-add-android+nativeaot-skia-sample-stage branch from d937156 to a2e3739 Compare August 29, 2025 11:31
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 174771 has failed on Uno.UI - CI.

@jonpryor jonpryor force-pushed the dev/jonpryor/jonp-add-android+nativeaot-skia-sample-stage branch from a2e3739 to c5fce5a Compare September 2, 2025 11:45
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 174930 has failed on Uno.UI - CI.

@jonpryor jonpryor force-pushed the dev/jonpryor/jonp-add-android+nativeaot-skia-sample-stage branch from c5fce5a to 97e3c21 Compare September 3, 2025 17:32
@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 175109 has failed on Uno.UI - CI.

@jonpryor jonpryor force-pushed the dev/jonpryor/jonp-add-android+nativeaot-skia-sample-stage branch from 97e3c21 to d1b7458 Compare September 11, 2025 17:42
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 175828 has failed on Uno.UI - CI.

@jonpryor jonpryor force-pushed the dev/jonpryor/jonp-add-android+nativeaot-skia-sample-stage branch from d1b7458 to 1f86e0e Compare September 11, 2025 20:51
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

…droid

Context: #21256 / 52a6f3e
Context: dotnet/android#10461
Context: dotnet/android#10457
Context: dotnet/android#10463

#21256 added support for building with .NET 10, and
one of the new features in .NET 10 is that Android has (very!)
preliminary preview support for [NativeAOT][0].

As building `SamplesApp.Skia.netcoremobile.csproj` with NativeAOT
takes a significant amount of time and disk space, we've decided to
introduce a new `Tests - Android+NativeAOT Skia` stage to build and
run these unit tests within an Android+NativeAOT environment.
To help reduce disk usage, after building the `.apk` we delete the
`obj` directory.

Update `android-run-skia-runtime-tests.sh` to always create
the `$(build.sourcesdirectory)/build/uitests-failure-results` path
before existing with an error, as failure to do so means that the
`PublishBuildArtifacts@1` YAML task fails:

	##[error]Publishing build artifacts failed with an error: Not found PathtoPublish: /agent/_work/1/s/build/uitests-failure-results

which in turn means subsequent `DownloadBuildArtifacts@0` /
**Download previous test runs failed tests** steps *also* always fail:

	##[error]Artifact uitests-android-nativeaot-failure-results not found for build 174635. Please ensure you have published artifacts in any previous phases of the current build.

Update `ApplicationData.GetRoamingFolder()` to explicitly create
`Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)`.
(Apparently this isn't created by default under NativeAOT?)
This avoids a startup assertion:

	I NativeAotFromAndroid: App failed to initialize: System.IO.DirectoryNotFoundException: IO_PathNotFound_Path, /data/user/0/uno.platform.samplesapp.skia/files/.config/b63c4306-f361-42d0-bc1d-5be385a95c78.txt
	I NativeAotFromAndroid:    at System.IO.FileSystem.DeleteFile(String) + 0xe7
	I NativeAotFromAndroid:    at SamplesApp.App.<AssertApplicationData>g__AssertCanCreateFile|32_3(StorageFolder) + 0x10c
	I NativeAotFromAndroid:    at SamplesApp.App.AssertApplicationData() + 0xa5
	I NativeAotFromAndroid:    at SamplesApp.App..ctor() + 0x2a3
	I NativeAotFromAndroid:    at SamplesApp.Droid.Application.<>c.<.ctor>b__0_0() + 0x18
	I NativeAotFromAndroid:    at Microsoft.UI.Xaml.NativeApplication.<OnActivityStarted>b__7_0() + 0x12
	I NativeAotFromAndroid:    at Uno.UI.Runtime.Skia.Android.AndroidHost.<Run>g__CreateApp|2_10(ApplicationInitializationCallbackParams _) + 0xf
	I NativeAotFromAndroid:    at Microsoft.UI.Xaml.Application.StartPartial(ApplicationInitializationCallback callback) + 0xb5
	I NativeAotFromAndroid:    at Uno.UI.Runtime.Skia.Android.AndroidHost.Run() + 0x306

Enable NativeAOT builds by updating
`SamplesApp.Skia.netcoremobile.csproj` to set the [`$(PublishAot)`][1]
property to the `$(SkiaPublishAot)` MSBuild property.  This allows
us to build a single project for NativeAOT --
`SamplesApp.Skia.netcoremobile.csproj` -- *without* trying to build
every referenced project for NativeAOT, which is what happens if you
instead try `dotnet publish -p:PublishAot=true …`:

	% dotnet build -c Release -p:PublishAot=true src/SamplesApp/SamplesApp.Skia.netcoremobile/SamplesApp.Skia.netcoremobile.csproj -bl
	…
	…/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(121,5): error NETSDK1207: Ahead-of-time compilation is not supported for the target framework.

	% dotnet publish src/SamplesApp/SamplesApp.Skia.netcoremobile/SamplesApp.Skia.netcoremobile.csproj \
	  -c Release -r android-x64 -f net10.0-android -p:UnoTargetFrameworkOverride=net10.0-android -p:SkiaPublishAot=true -bl
	# succeeds… after 15 minutes…

This also requires updating `$(NoWarn)` to ignore the hundreds of
IL trimmer warnings.  We're just trying to see where things stand for now.

Additionally, we need to publish with `-r android-x64` in order to
avoid the build error:

	…/Microsoft.NETCore.Native.Publish.targets(92,5): error MSB3030: Could not copy the file "bin/Release/net10.0-android/native/SamplesApp.so" because it was not found.

Because it's `bin/Release/net10.0-android/android-{arm64,x64}/native/SamplesApp.so`!

Oddly, using `-r android-x64` still results in *both* ABIs being
included, which appears to be a unoplatform/uno "bug":

	% unzip -l src/SamplesApp/SamplesApp.Skia.netcoremobile/bin/Release/net10.0-android/android-x64/publish/uno.platform.samplesapp.skia-Signed.apk | grep SamplesApp.so
	763563120  08-28-2025 19:47   lib/x86_64/libSamplesApp.so
	757982224  08-28-2025 19:48   lib/arm64-v8a/libSamplesApp.so

The need for `-r android-x64` may be related to dotnet/android#10457.

Finally, .NET Crypto support isn't propertly initialized in
Android+NativeAOT apps in .NET 10 RC1; see dotnet/android#10463.
This may be fixed in dotnet/android#10461, but in the meantime we can
manually call `AndroidCryptoNative_InitLibraryOnLoad()` so that
methods such as `SHA1.Create()` won't throw.

Note: Do *not* make Release-config apps [Debuggable][2] under
.NET 10 Preview 7 or earlier; you will run into
[dotnet/java-interop@90ac202e][3].

[0]: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/
[1]: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/?tabs=windows%2Cnet8#publish-native-aot-using-the-cli
[2]: https://developer.android.com/guide/topics/manifest/application-element#debug
[3]: dotnet/java-interop@90ac202
@jonpryor jonpryor force-pushed the dev/jonpryor/jonp-add-android+nativeaot-skia-sample-stage branch from 1f86e0e to ae41318 Compare September 12, 2025 00:06
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21359/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21359/docs/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 175870 has failed on Uno.UI - CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/automation Categorizes an issue or PR as relevant to project automation area/build Categorizes an issue or PR as relevant to build infrastructure platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants