Repository navigation
fix(ci): Resolve the Android launcher activity dynamically - #24120
Conversation
|
Claude finished @MartinZikmund's task in 1m 39s —— View job Review complete
SummaryVerdict: ✅ LGTM — no blocking issues This is a clean, well-motivated fix. The root cause (JCW class-name instability between Mono Correctness: The
Diagnostic fallback: When resolution fails, the script re-runs Quoting improvement: The original Comment quality: The block comment explaining Mono vs NativeAOT prefix differences is valuable and belongs in the code. No findings warranting inline comments. The PR is ready to merge pending the end-to-end validation on the Tests - Android+NativeAOT Skia leg. |
There was a problem hiding this comment.
Pull request overview
This PR fixes the Android Skia runtime-test launcher step by removing reliance on a hardcoded Java Callable Wrapper (JCW) activity name, which can change across toolchain modes (Mono vs NativeAOT) and versions. Instead, it resolves the launcher activity dynamically from the installed package before invoking am start, aligning with the instability described in issue #24119.
Changes:
- Resolve the app’s launcher activity at runtime via
adb shell cmd package resolve-activity --brief. - Fail fast with a clear error when no launcher activity can be resolved.
- Use the resolved component for
adb shell am start -n, replacing the previously hardcoded JCW activity.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24120/wasm-skia-net9/index.html |
morning4coffe-dev
left a comment
There was a problem hiding this comment.
Reviewed the Android command and shell failure behavior. Dynamic resolve-activity, CR/output validation, and the quoted am start component handle Mono and NativeAOT wrapper changes without hardcoded JCW names.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
35e2683 to
c6d8934
Compare
|
Claude finished @MartinZikmund's task in 1m 26s —— View job Review complete
SummaryVerdict: ✅ LGTM — no blocking issues This is a clean shell-script-only change; the AGENTS.md C#/XAML rules do not apply. Reviewing against shell correctness, robustness, and
Diagnostic fallback (lines 140-142): Re-running Quoting: The new Comment quality: The block comment explaining Mono No findings warrant inline comments. The PR is ready to merge pending the Tests - Android+NativeAOT Skia end-to-end leg on this PR. |
c6d8934 to
65605f8
Compare
|
Claude finished @MartinZikmund's task in 1m 40s —— View job Review complete
SummaryVerdict: ✅ LGTM — no blocking issues This is a shell-script-only change; the C#/XAML and DependencyProperty rules from AGENTS.md do not apply. Reviewing against shell correctness, Root cause and fix: The diagnosis is correct — the JCW class-name prefix (
Parsing: Diagnostic fallback (lines 145-147): Re-running Quoting: New code correctly quotes both Comment quality: The block comment explaining Mono Conventional Commits: No findings warrant inline comments. The PR is ready to merge pending the Tests - Android+NativeAOT Skia end-to-end validation on this PR's CI run. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24120/wasm-skia-net9/index.html |
The Android runtime-test script launched the app with a hardcoded Java Callable Wrapper name, `crc6448f3b0362cbf4bc9.MainActivity`. That name is generated by the Android toolchain and is not stable. Since the update to .NET 11 Preview 7 (#24054) the NativeAOT build emits its wrappers through the typemap as `scrc64<hash>` rather than `crc64<hash>`, and with a different hash. Comparing the generated stubs across the last green and first red builds of `Tests - Android+NativeAOT Skia`: 40c4a89 (green): typemap/java/crc6448f3b0362cbf4bc9/MainActivity.java c2831a9 (red): typemap/java/scrc6415f86cac20992436/MainActivity.java so `am start` failed with "Activity class {...} does not exist", the app never ran, no TestResult XML was produced, and the stage failed on all five attempts. Resolve the launcher activity from the installed package instead. This covers both wrapper schemes, absorbs the hash changing when an activity's namespace or assembly moves (as when the SamplesApp heads are consolidated), and fails fast with a clear message instead of timing out and reporting "did nunit crash?". Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Xn8SQpybcpmMCwFmbCzSWt
65605f8 to
0589bca
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24120/wasm-skia-net9/index.html |
|
Claude finished @MartinZikmund's task in 1m 20s —— View job Review complete
SummaryVerdict: ✅ LGTM — no blocking issues This is a shell-script-only change. Reviewing against shell correctness, Root cause and fix: The diagnosis is correct — the JCW class-name prefix (
Parsing: Diagnostic fallback (lines 145–147): Re-running Quoting: New code correctly quotes both Comment quality: The block comment explaining Mono Conventional Commits: No findings warrant inline comments. The PR is ready to merge pending the Tests - Android+NativeAOT Skia end-to-end validation leg on this PR's CI run. |
GitHub Issue: closes #24119
PR Type:
🏗️ Build or CI related changes
What changed? 🚀
Current behavior.
build/test-scripts/android-run-skia-runtime-tests.shlaunched the app with a hardcoded Java Callable Wrapper class name:adb shell am start -n $UNO_UITEST_APP_ID/crc6448f3b0362cbf4bc9.MainActivityThat name is generated by the Android toolchain and is not a stable contract. Since the update to .NET 11 Preview 7 (#24054), the NativeAOT build emits its wrappers through the typemap as
scrc64<hash>rather thancrc64<hash>— different prefix and different hash — so the launch failed with:The app never started, no
TestResult*.xmlwas produced, and Tests - Android+NativeAOT Skia failed on all five attempts, on every branch build since.Evidence, from the
samplesapp-android-skia-nativeaot-logsbinlog on either side of the regression:40c4a8981typemap/java/crc6448f3b0362cbf4bc9/MainActivity.javac2831a9b45ftypemap/java/scrc6415f86cac20992436/MainActivity.javagit log 40c4a8981..9582c40fdcontains only the toolchain bump ("Update to .NET 11 Preview 7", "use Mono.Cecil 0.11.6") — no Uno source changes. The Mono-based Tests - Android Skia stage is unaffected because it still emitscrc64….This change resolves the launcher activity from the installed package instead of hardcoding it:
UNO_UITEST_ACTIVITY=$(adb shell cmd package resolve-activity --brief "$UNO_UITEST_APP_ID" | tail -n 1 | tr -d '\r' || true)This is deliberately name-agnostic rather than swapping in the new constant, because the hash also moves whenever an activity's namespace or assembly changes — including when the SamplesApp heads are consolidated in #24046, which removes heads declaring
namespace SamplesApp.Droid. It also fails fast with a clear message when nothing resolves, instead of waiting out the timeout and reporting the misleadingdid nunit crash ?.Validation
bash -npasses. The resolution logic was exercised against a stubbedadbcovering all three cases:…/scrc6415f86cac20992436.MainActivity(NativeAOT, current)…/crc6448f3b0362cbf4bc9.MainActivity(Mono, and #24046)No activity foundThe old code sends the wrong component in the first case — which is exactly the observed CI failure. End-to-end proof needs the emulator, so the Tests - Android+NativeAOT Skia leg on this PR is the real validation.
PR Checklist ✅
adbmatrix above and by the Android+NativeAOT leg on this PRScreenshots Compare Test Runresults.