Repository navigation
TodoApp.Avalonia.Android: SkiaSharp native library not 16 KB page-size aligned (XA0141) #522
Description
Summary
Surfaced by the new mobile CI added in #511 (PR #519), specifically the TodoApp.Avalonia.Android build (net10.0-android). The build succeeds, but produces:
Xamarin.Android.Common.targets(2417,3): warning XA0141: Android 16 will require 16 KB page sizes, shared
library 'libSkiaSharp.so' does not have a 16 KB page size. Please inform the authors of the NuGet package
'SkiaSharp.NativeAssets.Android' version '2.88.9' which contains 'runtimes/android-arm64/native/libSkiaSharp.so'.
See https://developer.android.com/guide/practices/page-sizes for more details.
(reported once per ABI - android-arm64 and android-x64 - and once per compile pass, so 4 total lines for 2 distinct findings.)
Root cause
SkiaSharp.NativeAssets.Android isn't referenced directly anywhere in samples/todoapp/TodoApp.Avalonia/; it's a transitive dependency of Avalonia.Android (Avalonia renders via Skia). samples/todoapp/TodoApp.Avalonia/Directory.Build.props pins AvaloniaVersion to 11.3.18, which resolves SkiaSharp.NativeAssets.Android to 2.88.9 - a version whose native libSkiaSharp.so binaries predate 16 KB memory page size alignment. Newer SkiaSharp releases exist upstream (checked nuget.org directly: versions well past 4.15x.x are published today, vs. the 2.88.9 pulled in here), so this is plausibly already fixed further up the dependency chain, but SkiaSharp.NativeAssets.Android's version here is entirely controlled by whatever version Avalonia.Android 11.3.18 depends on - it isn't something this repo pins directly today.
Impact
Low/informational today - this is a forward-looking compatibility warning, not a build failure, and doesn't affect arm64/x64 devices running current Android page sizes. It will become a real compatibility problem once 16 KB page size becomes mandatory (Android has been phasing this in via Play Store requirements for new app submissions), so it shouldn't be ignored indefinitely.
Suggested fix directions (needs investigation before picking one)
- Check whether a newer
Avalonia/Avalonia.Androidrelease (past11.3.18) already pulls a 16 KB-alignedSkiaSharp.NativeAssets.Android. If so, bumpingAvaloniaVersioninsamples/todoapp/TodoApp.Avalonia/Directory.Build.propsis the cleanest fix and would also apply automatically toTodoApp.Avalonia.iOS/.Desktop. - If no compatible Avalonia release exists yet, consider whether explicitly overriding
SkiaSharp.NativeAssets.Androidto a newer version (independent of Avalonia's own pin) is safe - this carries some risk of a version mismatch with whatever native API surface Avalonia's Skia bindings expect from that release, so would need real on-device/emulator testing, not just a clean build. - If neither is viable yet, this may simply need to wait on upstream (Avalonia/SkiaSharp) and be revisited later - in which case this issue should stay open as a tracking item rather than being closed with a workaround.
This is a samples/ dependency-version investigation, similar in shape to #506 (Uno's Uno.WinUI/CommunityToolkit.WinUI.Behaviors conflict) - the right fix isn't obvious without testing an actual Avalonia version bump on a real Android target.
Related
- Add CI workflow to build mobile /samples heads: Android, iOS, Uno (Phase 3 of #509) #511 / PR ci: add build-samples workflow for Phase 3 mobile heads (#511) #519 - Phase 3 samples CI rollout, where this was surfaced.
Activity
adrianhall commentedon Jul 11, 2026
Investigation
Dug into all three suggested fix directions before picking one.
1. Bump Avalonia past
11.3.18to pick up a 16 KB-aligned SkiaSharpConfirmed via NuGet nuspec inspection:
Avalonia.Skia 11.3.18(the latest published11.xrelease) still pinsSkiaSharp 2.88.9— and2.88.9is itself the latest published2.xrelease of SkiaSharp (checked the full version list on nuget.org). There is no newer2.xpatch anywhere upstream that fixes 16 KB page-size alignment.Avalonia 12.xmoves off SkiaSharp2.xentirely. E.g.Avalonia.Skia 12.1.0→SkiaSharp 3.119.4→SkiaSharp.NativeAssets.Android 3.119.4, which should carry the 16 KB fix.So the only upstream path to a fix is the Avalonia 11 → 12 major-version bump — which is already fully scoped as its own issue, #507 (breaking
App.axaml.cschanges, Android lifetime rework, newApplication.cs,Avalonia.Diagnosticsremoval, etc.). Doing that bump here would duplicate #507's scope and blow well past a single-responsibility fix for this issue.2. Explicitly override
SkiaSharp.NativeAssets.Androidto a 3.x version while staying on Avalonia11.3.18This is exactly the risk the issue itself called out. Avalonia
11.3.18's managedAvalonia.Skiacode is compiled against the SkiaSharp 2.88.9 managed API/native ABI. Swapping only the native asset package to a3.xbuild risks a native/managed mismatch that:dotnet buildwould not catch (the APK builds fine either way),dotnet test/publish/device run for/samples) would not catch either,There's no real Android device/emulator available in this workflow to validate that, so this can't be shipped as a verified fix today.
3. Wait on upstream / revisit later
Given (1) is already tracked separately (#507) and (2) can't be safely verified here, there's no independent, verifiable code change left to make for this issue specifically. The real fix is riding along with #507's Avalonia 12 migration — once that lands, this warning should disappear as a side effect (worth a quick confirm at that point).
Resolution
Closing as won't fix (not because the warning doesn't matter, but because there is no distinct fix to make here — see #507). #507 is the actual fix vector for this and should be confirmed/re-checked for the
XA0141warning once it lands.Related: #507