You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] TouchBehavior fails with MethodAccessException when using MAUI 9.0.40 #3089
TouchBehavior throws a System.MethodAccessException at runtime when running against the latest dotnet/maui (9.0.40).
Probably because TouchBehavior.android.cs calls the internal method Microsoft.Maui.Platform.ViewExtensions.GetParentOfType<T>(), but dotnet/maui removed the InternalsVisibleTo attribute for CommunityToolkit assemblies in PR dotnet/maui#33442.
Expected Behavior
No runtime exception.
Stack trace
[System.MethodAccessException]: Method `Microsoft.Maui.Platform.ViewExtensions.GetParentOfType[Android.Views.ViewGroup](Android.Views.View)' is inaccessible from method `CommunityToolkit.Maui.Behaviors.TouchBehavior.OnAttachedTo(Microsoft.Maui.Controls.VisualElement,Android.Views.View)'
at CommunityToolkit.Maui.Behaviors.TouchBehavior.OnAttachedTo + 0x16(Unknown Source)
at Microsoft.Maui.Controls.PlatformBehavior`2[[Microsoft.Maui.Controls.VisualElement, Microsoft.Maui.Controls, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null],[Android.Views.View, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065]].OnLoaded + 0x37(Unknown Source)
[System.MethodAccessException]: Method `Microsoft.Maui.JavaObjectExtensions.IsAlive(Java.Lang.Object)' is inaccessible from method `CommunityToolkit.Maui.Behaviors.TouchBehavior.UpdateClickHandler()'
Workaround: Downgrading MAUI version to 10.0.31 works with CommunityToolkit.MAUI version 14.0.0 (13.0.0 with 10.0.40 still crashes the Android application)
Closing this issue just a few hours before the release was probably not the smartest thing to do... @VladislavAntonyuk Could you please reopen this issue?
Reacted by Howon Lee, melimion, dartasen and kakkamstrup
Hello,
I can confirm that we are experiencing the same issue on our side as well.
I’m available to help if a reproduction example is needed.
System.MethodAccessException: Method `Microsoft.Maui.Platform.ViewExtensions.GetParentOfType[Android.Views.ViewGroup](Android.Views.View)' is inaccessible from method `CommunityToolkit.Maui.Behaviors.TouchBehavior.OnAttachedTo(Microsoft.Maui.Controls.VisualElement,Android.Views.View)'
at CommunityToolkit.Maui.Behaviors.TouchBehavior.OnAttachedTo(VisualElement bindable, View platformView) in /_/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs:line 44
at Microsoft.Maui.Controls.PlatformBehavior`2[[Microsoft.Maui.Controls.VisualElement, Microsoft.Maui.Controls, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null],[Android.Views.View, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065]].OnLoaded(Object sender, EventArgs e) in /_/src/Controls/src/Core/Interactivity/PlatformBehavior.cs:line 107
at Microsoft.Maui.Controls.VisualElement.SendLoaded(Boolean updateWiring) in /_/src/Controls/src/Core/VisualElement/VisualElement.cs:line 2362
at Microsoft.Maui.Controls.VisualElement.SendLoaded() in /_/src/Controls/src/Core/VisualElement/VisualElement.cs:line 2355
at Microsoft.Maui.Platform.ViewExtensions.<>c__DisplayClass44_0.<OnLoaded>b__2(Object _, ViewAttachedToWindowEventArgs __) in /_/src/Core/src/Platform/Android/ViewExtensions.cs:line 600
at Android.Views.View.IOnAttachStateChangeListenerImplementor.OnViewAttachedToWindow(View attachedView)
at Android.Views.View.IOnAttachStateChangeListenerInvoker.n_OnViewAttachedToWindow_Landroid_view_View_(IntPtr jnienv, IntPtr native__this, IntPtr native_attachedView)
changed the title [-][BUG] TouchBehavior fails with MethodAccessException when using dotnet/maui main branch[/-][+][BUG] TouchBehavior fails with MethodAccessException when using MAUI 9.0.40[/+]on Feb 13, 2026
I am working with the .NET MAUI engineers team to resolve this and have opened an Issue on the .NET MAUI repo: dotnet/maui#34048
Root Cause
This .NET MAUI PR revoked InteralsVisibleTo for the .NET MAUI Toolkits which is causing the Issue. InteralsVisibleTo allowed us to access non-public APIs that we can no longer access in Microsoft.Maui.Controls v10.0.40.
Short Term Plan
In the short-term, the .NET MAUI Engineering team plans to revert dotnet/maui#33442 and publish Microsoft.Maui.Controls v10.0.41.
After Microsoft.Maui.Controls v10.0.41 is released, we will publish CommunityToolkit.Maui v14.0.1 which will take a dependency on Microsoft.Maui.Controls v10.0.41 to ensure no developers accidentally try to use Microsoft.Maui.Controls v10.0.40.
Long Term Plan
In the long-term, I've asked the .NET MAUI Engineering team to promote the APIs we use from internal to public. Once this is done, we will proceed with re-revoking InteralsVisibleTo for the .NET MAUI Toolkits and I will work directly with the .NET MAUI Engineering team to ensure no breaking changes to the .NET MAUI Toolkits.
Reacted by Stephan Arnas, dartasen, ManyWork, Shakeel Ahmed, TedMobile, Koen Zwikstra and Steeven Lopes
Activity
tranb3r commentedon Feb 12, 2026
Also seeing this one:
VladislavAntonyuk commentedon Feb 12, 2026
We don't support preview versions. We'll get a compilation error if we use inaccessible method.
airtaxi commentedon Feb 13, 2026
This happens even with official MAUI 10.0.40 and CommunityToolkit.MAUI 14.0.0
airtaxi commentedon Feb 13, 2026
Workaround: Downgrading MAUI version to 10.0.31 works with CommunityToolkit.MAUI version 14.0.0 (13.0.0 with 10.0.40 still crashes the Android application)
tranb3r commentedon Feb 13, 2026
Closing this issue just a few hours before the release was probably not the smartest thing to do...
@VladislavAntonyuk Could you please reopen this issue?
StephanArnas commentedon Feb 13, 2026
Hello,
I can confirm that we are experiencing the same issue on our side as well.
I’m available to help if a reproduction example is needed.
[-][BUG] TouchBehavior fails with MethodAccessException when using dotnet/maui main branch[/-][+][BUG] TouchBehavior fails with MethodAccessException when using MAUI 9.0.40[/+]TheCodeTraveler commentedon Feb 13, 2026
This appears to be a breaking change in the latest version of .NET / .NET MAUI.
I'm looking into it now.
Related Isues:
TheCodeTraveler commentedon Feb 13, 2026
I've confirmed that this is a bug introduced by breaking changes in
Microsoft.Maui.Controls v10.0.40Workaround
To use
CommunityToolkit.Maui v14.0.0, downgrade toMicrosoft.Maui.Controls v10.0.31until the .NET MAUI team can publish a fixTheCodeTraveler commentedon Feb 13, 2026
Update
I am working with the .NET MAUI engineers team to resolve this and have opened an Issue on the .NET MAUI repo: dotnet/maui#34048
Root Cause
This .NET MAUI PR revoked
InteralsVisibleTofor the .NET MAUI Toolkits which is causing the Issue.InteralsVisibleToallowed us to access non-public APIs that we can no longer access inMicrosoft.Maui.Controls v10.0.40.Short Term Plan
In the short-term, the .NET MAUI Engineering team plans to revert dotnet/maui#33442 and publish
Microsoft.Maui.Controls v10.0.41.After
Microsoft.Maui.Controls v10.0.41is released, we will publishCommunityToolkit.Maui v14.0.1which will take a dependency onMicrosoft.Maui.Controls v10.0.41to ensure no developers accidentally try to useMicrosoft.Maui.Controls v10.0.40.Long Term Plan
In the long-term, I've asked the .NET MAUI Engineering team to promote the APIs we use from
internaltopublic. Once this is done, we will proceed with re-revokingInteralsVisibleTofor the .NET MAUI Toolkits and I will work directly with the .NET MAUI Engineering team to ensure no breaking changes to the .NET MAUI Toolkits.