Repository navigation
ci(maui): build, check and smoke-test the Android sample in Release (#368) - #369
Merged
Merged
Conversation
…368) The maui job built the sample for Android only in Debug, which has no AOT images, so #366 (the APK shipped assemblies its AOT images were not compiled from, and the app aborted at startup) passed CI. - ci.yml maui: build the sample in Release (ILLink and AOT, arm64 and x86_64) with -warnaserror, then run tools/ApkAotCheck on the APK. - tools/ApkAotCheck: reads each ABI's assembly store from the APK and requires that every libaot-X.so holds X's MVID and only MVIDs of assemblies the APK ships. Fails the #366 APK with 19 problems per ABI. - maui-android.yml: Release x86_64 build, the same check, and the smoke intent on an API 35 emulator via smoke-android.sh. Weekly and on pull requests touching the sample or its inputs (open decision 9). Signed-off-by: Michael Stonis <michael.stonis@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Linux target selection, smoke-monitoring races and missing automated checker coverage need correction before approval.
3 open issues
What changed in this PR
Adds Android Release coverage for the MAUI sample to catch assembly/AOT mismatches behind #366, building on #367.
Changes:
- Builds and checks Release APKs in regular CI.
- Adds scheduled, manual and path-triggered emulator smoke testing.
- Introduces an APK consistency checker and documents the workflow.
| File | Description |
|---|---|
tools/ApkAotCheck/README.md |
Documents checker usage and validation. |
tools/ApkAotCheck/Program.cs |
Provides command-line reporting and exit codes. |
tools/ApkAotCheck/ApkAotChecker.cs |
Reads packaged assemblies and checks AOT identifiers. |
tools/ApkAotCheck/ApkAotCheck.csproj |
Defines the checker executable. |
samples/Broadside.Viewer.Maui.Sample/smoke-android.sh |
Installs and monitors the smoke run. |
samples/Broadside.Viewer.Maui.Sample/README.md |
Documents Android smoke execution. |
samples/Broadside.Viewer.Maui.Sample/Broadside.Viewer.Maui.Sample.csproj |
Restores default Android linking. |
Broadside.slnx |
Includes the checker project. |
Broadside.Core.slnf |
Includes the checker in core validation. |
.github/workflows/README.md |
Documents Release and emulator coverage. |
.github/workflows/maui-android.yml |
Adds the emulator smoke workflow. |
.github/workflows/ci.yml |
Adds Release builds and APK checks. |
Review effort: Balanced
Comment on lines
+77
to
+78
| dotnet build samples/Broadside.Viewer.Maui.Sample -f net10.0-android -c Release -warnaserror | ||
| -p:RuntimeIdentifier=android-x64 -p:AndroidSdkDirectory="$ANDROID_HOME" |
Comment on lines
+21
to
+38
| pid=$(adb shell pidof "$package" | tr -d '\r') | ||
|
|
||
| while (( SECONDS - start < timeout )); do | ||
| log=$(adb logcat -d) | ||
| if grep -q "BROADSIDE_SMOKE_OK" <<<"$log"; then | ||
| grep -m 1 "BROADSIDE_SMOKE_OK" <<<"$log" | ||
| echo "Smoke run passed in $(( SECONDS - start )) s." | ||
| exit 0 | ||
| fi | ||
|
|
||
| # monodroid only logs for .NET apps, and this emulator runs one; a fatal signal counts only in the app's process. | ||
| if grep -qE "BROADSIDE_SMOKE_FAILED|F monodroid" <<<"$log" || { [[ -n "$pid" ]] && grep -qE "Fatal signal.* pid $pid " <<<"$log"; }; then | ||
| echo "Smoke run failed after $(( SECONDS - start )) s." | ||
| dump_log | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ -z "$(adb shell pidof "$package" | tr -d '\r')" ]]; then |
| private const string AotImagePrefix = "libaot-"; | ||
| private const string AssemblyStoreFile = "libassembly-store.so"; | ||
|
|
||
| public static IReadOnlyList<AbiReport> Check(string apkPath) |
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #368
Stacked on #367. This branch merges
366-maui-android-aot-crashso the new Release coverage runs against the fixed sample. Merge #367 first; after that, this diff is only the CI change. Without #367, the newmauistep fails on the integration branch, which is the point of the step.Summary
CI's
mauijob built the MAUI sample for Android only in Debug. Debug has no AOT images, so #366 got through: in Release, the APK packaged assemblies its AOT images were not compiled from, and the app aborted at startup.ci.yml›maui(every PR): builds the sample in Release with-warnaserror(ILLink and AOT on, default ABIs arm64 and x86_64), then runstools/ApkAotCheckon the APK.tools/ApkAotCheck(new): the brief proposed comparingobj/.../android/assets/<abi>/withobj/.../aot-in/. Those folders only exist withAndroidLinkMode=None; with the SDK default (SdkOnly, which fix(viewer): Android MAUI sample crashes at startup with AOT (#366) #367 restores) both are missing, so that check would pass without checking anything. This tool checks the APK instead. Mono writes into each AOT image the MVIDs of the assembly it compiled and of every assembly that one references. For each ABI, the tool readslibassembly-store.so(ELFpayloadsection, store v3, LZ4-compressed entries), takes each assembly's MVID, and requires two things: everylibaot-X.soholds X's MVID, and it holds no MVID of an assembly the APK doesn't ship. It fails when it finds no AOT images, and it fails loudly on an unknown store version.maui-android.yml(new; weekly,workflow_dispatch, and PRs that touch the sample, the viewer shells,tools/ApkAotCheck,Directory.*.propsorglobal.json): builds Release forandroid-x64, runs the same check, boots an API 35 x86_64 emulator (reactivecircus/android-emulator-runner, SwiftShader) and runssamples/Broadside.Viewer.Maui.Sample/smoke-android.sh. That script installs the APK, sends the smoke intent, and requiresBROADSIDE_SMOKE_OKbefore any of:BROADSIDE_SMOKE_FAILED, anF monodroidabort, a fatal signal in the app's pid, the process exiting, or 300 s. I kept it out ofci.ymlper spec Spec: Broadside v1 #33 open decision 9, the same asandroid.yml.Docs:
.github/workflows/README.md(themauirow and a new section),tools/ApkAotCheck/README.md, and the sample README.Public API changes
None. No spec clause, so no conformance rows.
Time added
ci.yml›maui: Release build + checkmaui-android.yml›smoke(whole job, not on every PR)dotnet build … -c ReleaseBROADSIDE_SMOKE_OKsmoke-android.shon an API 35 SwiftShader emulatorVerification
ApkAotCheckreportsarm64-v8a: 102 assemblies, 102 AOT images, OKand the same for x86_64, exit 0.-p:AndroidLinkMode=None, 299 assemblies): exit 1, 19 problems per ABI, for examplelibaot-Xamarin.AndroidX.Core.dll.so was compiled from a different Xamarin.AndroidX.Core.dll than the one packaged, and 16 images compiled against the unmodified AndroidX.Core MVID.smoke-android.shon a throwaway API 35 arm64 AVD with-gpu swiftshader_indirect:BROADSIDE_SMOKE_OK pages=14 page=1 size=1080x1980 … gpu=True, exit 0class-init.c:2474 … klass->instance_size == instance_sizedotnet build tools/ApkAotCheck -c Release -warnaserroranddotnet format tools/ApkAotCheck/ApkAotCheck.csproj --verify-no-changesare clean (the tool is inBroadside.slnxandBroadside.Core.slnf, sobuild-testandformatcover it).actionlintis clean on both workflows.🤖 Generated with Claude Code