Description
Microsoft.Maui.Controls 10.0.70 crashes on Android when an accessibility service (Voice Access, TalkBack, etc.) is active and a CollectionView with SelectionMode != None is visible. The crash is:
System.MissingMethodException: Method not found: void AndroidX.Core.View.Accessibility.AccessibilityNodeInfoCompat.set_Checked(bool)
at Microsoft.Maui.Platform.MauiAccessibilityDelegateCompat.OnInitializeAccessibilityNodeInfo
Root cause
Xamarin.AndroidX.Core 1.17.0.2 changed AccessibilityNodeInfoCompat.Checked from a bool property to an int property — a binary breaking change:
1.16.0.3: bool Checked { get; set; } → void set_Checked(bool)
1.17.0.2: int Checked { get; set; } → void set_Checked(int) + SetChecked(bool)
MAUI 10.0.70's MauiAccessibilityDelegateCompat.OnInitializeAccessibilityNodeInfo (in Microsoft.Maui.dll) was compiled against 1.16.0.3 and calls set_Checked(bool). At runtime, if Xamarin.AndroidX.Core has been resolved to 1.17.0.2 (e.g., pulled in transitively by another package), set_Checked(bool) no longer exists → MissingMethodException.
This is not an IL linker issue. The method signature was removed from 1.17.0.2.
The fix: MauiAccessibilityDelegateCompat.OnInitializeAccessibilityNodeInfo should call SetChecked(bool) (present in both 1.16.0.3 and 1.17.0.2) instead of the bool Checked property setter.
Reproduction repository
https://github.com/edgiardina/MauiAccessibilityRepro
Steps to reproduce
- Clone https://github.com/edgiardina/MauiAccessibilityRepro
- Connect an Android device
- Enable Voice Access:
adb shell settings put secure enabled_accessibility_services com.google.android.apps.accessibility.voiceaccess/.JustSpeakService
adb shell settings put secure accessibility_enabled 1
- Build and deploy in Release mode:
dotnet build -t:Run -f net10.0-android -c Release -p:AndroidAttachDebugger=false
- Tap "Navigate to CollectionView page"
Actual behavior
App crashes:
E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: android.runtime.JavaProxyThrowable: [System.MissingMethodException]: Method not found: void AndroidX.Core.View.Accessibility.AccessibilityNodeInfoCompat.set_Checked(bool)
E AndroidRuntime: at Microsoft.Maui.Platform.MauiAccessibilityDelegateCompat.OnInitializeAccessibilityNodeInfo + 0x43(Unknown Source)
E AndroidRuntime: at AndroidX.Core.View.AccessibilityDelegateCompat.n_OnInitializeAccessibilityNodeInfo_Landroid_view_View_Landroidx_core_view_accessibility_AccessibilityNodeInfoCompat_ + 0x25(Unknown Source)
E AndroidRuntime: at crc6452ffdc5b34af3a0f.MauiAccessibilityDelegateCompat.n_onInitializeAccessibilityNodeInfo(Native Method)
E AndroidRuntime: at crc6452ffdc5b34af3a0f.MauiAccessibilityDelegateCompat.onInitializeAccessibilityNodeInfo(MauiAccessibilityDelegateCompat.java:36)
E AndroidRuntime: at androidx.core.view.AccessibilityDelegateCompat$AccessibilityDelegateAdapter.onInitializeAccessibilityNodeInfo(AccessibilityDelegateCompat.java:90)
E AndroidRuntime: at android.view.View.onInitializeAccessibilityNodeInfo(View.java:9835)
E AndroidRuntime: at android.view.View.createAccessibilityNodeInfoInternal(View.java:9796)
E AndroidRuntime: at android.view.View$AccessibilityDelegate.createAccessibilityNodeInfo(View.java:34809)
E AndroidRuntime: at android.view.View.createAccessibilityNodeInfo(View.java:9779)
E AndroidRuntime: at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1622)
Environment
Microsoft.Maui.Controls 10.0.70
Xamarin.AndroidX.Core 1.17.0.2 (pinned in repro; in production apps this arrives transitively)
- .NET 10,
net10.0-android, minSdk 24
- Build configuration: Release
- Confirmed on Android 16 (API 36, Samsung Galaxy S23)
Workaround
Either:
- Downgrade to
Microsoft.Maui.Controls 10.0.51
- Or pin
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.16.0.3" /> in your app
Description
Microsoft.Maui.Controls10.0.70 crashes on Android when an accessibility service (Voice Access, TalkBack, etc.) is active and aCollectionViewwithSelectionMode!=Noneis visible. The crash is:Root cause
Xamarin.AndroidX.Core 1.17.0.2changedAccessibilityNodeInfoCompat.Checkedfrom aboolproperty to anintproperty — a binary breaking change:1.16.0.3:bool Checked { get; set; }→void set_Checked(bool)1.17.0.2:int Checked { get; set; }→void set_Checked(int)+SetChecked(bool)MAUI 10.0.70's
MauiAccessibilityDelegateCompat.OnInitializeAccessibilityNodeInfo(inMicrosoft.Maui.dll) was compiled against1.16.0.3and callsset_Checked(bool). At runtime, ifXamarin.AndroidX.Corehas been resolved to1.17.0.2(e.g., pulled in transitively by another package),set_Checked(bool)no longer exists →MissingMethodException.This is not an IL linker issue. The method signature was removed from
1.17.0.2.The fix:
MauiAccessibilityDelegateCompat.OnInitializeAccessibilityNodeInfoshould callSetChecked(bool)(present in both1.16.0.3and1.17.0.2) instead of thebool Checkedproperty setter.Reproduction repository
https://github.com/edgiardina/MauiAccessibilityRepro
Steps to reproduce
Actual behavior
App crashes:
Environment
Microsoft.Maui.Controls10.0.70Xamarin.AndroidX.Core1.17.0.2 (pinned in repro; in production apps this arrives transitively)net10.0-android, minSdk 24Workaround
Either:
Microsoft.Maui.Controls10.0.51<PackageReference Include="Xamarin.AndroidX.Core" Version="1.16.0.3" />in your app