Repository navigation
fix(android): JNI-based setChecked to span AndroidX.Core 1.16/1.17 (backport #23262) - #23285
Merged
agneszitte merged 1 commit intoMay 18, 2026
Merged
Conversation
AndroidX.Core 1.17.0 changed the AccessibilityNodeInfoCompat.setChecked binding from setChecked(boolean) to setChecked(int) with state constants. When Uno.UI is compiled against one binding version and the consuming app pulls in the other (e.g. transitively via Sentry), the managed setter throws MissingMethodException at runtime (fixes #22999). This calls setChecked through JNI directly, probing both Java signatures once and dispatching to whichever the loaded binding exposes. The C# Checked property is no longer touched, so the fix stays neutral to the AndroidX.Core version the final app ships - no AndroidX or SupportedOSPlatformVersion bumps required. Alternative path to #23097, which solved the same crash by bumping AppCompat to 1.7.1.3 and cascading the AndroidX stack to minSdk 23. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> (cherry picked from commit e933487)
5 tasks
agneszitte
approved these changes
May 18, 2026
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23285/wasm-skia-net9/index.html |
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.
Summary
Fixes #22999 by calling
AccessibilityNodeInfoCompat.setCheckedthrough JNI rather than the managed C# property.Xamarin.AndroidX.Core 1.17.0changed thesetCheckedbinding fromsetChecked(boolean)tosetChecked(int)(state constants). When Uno.UI is compiled against one binding version and the consuming app pulls in the other transitively (the reported case wasSentry.Bindings.Android≥ 6.2.0 dragging in Core 1.17.0), the managed setter throwsMissingMethodExceptionat runtime.Both binding versions wrap the same underlying Java method whose JNI signature simply changed from
(Z)Vto(I)V. The newAccessibilityNodeInfoCompatJnihelper probes both signatures once on first use and dispatches to whichever the loaded binding exposes — no managed reflection, AOT/trim safe.Alternative to #23097
This is a deliberately narrower path than the already-merged #23097, which solved the same crash by bumping
Xamarin.AndroidX.AppCompat 1.7.0.7 → 1.7.1.3and cascading newer Activity / Fragment / Lifecycle / SavedState / Collection bindings, plus raisingSupportedOSPlatformVersionto 23. That cascade in turn forced uno.templates to either bump matching bindings on its side or ride the new minSdk 23 floor, and brokeMicrosoft.Maui.Controls 10.0.60's transitively-pinned older.Ktxpackages (NU1605/NU1608).The JNI helper here resolves #22999 without touching AppCompat, the surrounding AndroidX stack, the minimum Android API level, or Maui's binding pins. Branch is based on the commit immediately before #23097 merged, so the PR diff shows exactly the cost of the fix.
Test plan
Uno.UI.Runtime.Skia.Androidagainst anAndroidX.Core 1.16.xbaseline (default in the branch's base commit) and confirmnode.Checkedcallers compile and run.Xamarin.AndroidX.Core 1.17.0+(e.g.Sentry.Bindings.Android 6.3.0).ToggleButton/CheckBoxsoUnoExploreByTouchHelper.OnPopulateNodeForVirtualViewruns.MissingMethodExceptionis logged and TalkBack reports the checked state correctly under both Core 1.16.x and 1.17.x.🤖 Generated with Claude Code
This is an automatic backport of pull request #23262 done by Mergify.