Skip to content

[BUG] System.MissingMethodException No constructor found for CommunityToolkit.Maui.Behaviors.TouchBehavior+AccessibilityListener #2950

Closed

Description

@semdelion

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

This happens sometimes in production when the app was sent to background or resumes from background. I suppose that the system tries to restore an instance of AccessibilityListener using the specified constructor. This may be fixable by adding this constructor while doing the appropriate base call.

Expected Behavior

No crash

Steps To Reproduce

Unfortunately, I was unable to reproduce the problem.

Link to public reproduction project repository

null

Environment

- .NET MAUI CommunityToolkit: 12.3.0
- OS: Android 11-15
- .NET MAUI: 9.0.120

Anything else?

I reopened the issue #2383
I'm seeing this error in the App Center logs. I couldn't reproduce the crash myself.

I assume a similar fix should help: xamarin/XamarinCommunityToolkit@33c36af

App Center Crash:
[10:07:00.177 mem:41885640 FTL] Unhandled Exception Error logged in MainApplication.cs->UnhandledExceptionRaiser:274 

 Subject: null 

 System.NotSupportedException: Unable to activate instance of type CommunityToolkit.Maui.Behaviors.TouchBehavior+AccessibilityListener from native handle 0x7fd420e438 (key_handle 0x4a71429).
 ---> System.MissingMethodException: No constructor found for CommunityToolkit.Maui.Behaviors.TouchBehavior+AccessibilityListener::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership)
 ---> Java.Interop.JavaLocationException: Exception_WasThrown, Java.Interop.JavaLocationException
Java.Lang.Error: Exception_WasThrown, Java.Lang.Error

  --- End of managed Java.Lang.Error stack trace ---
java.lang.Error: Java callstack:
	at crc640fd0ddb16fe433d4.TouchBehavior_AccessibilityListener.n_onAccessibilityStateChanged(Native Method)
	at crc640fd0ddb16fe433d4.TouchBehavior_AccessibilityListener.onAccessibilityStateChanged(TouchBehavior_AccessibilityListener.java:31)
	at android.view.accessibility.AccessibilityManager.lambda$notifyAccessibilityStateChanged$0(AccessibilityManager.java:1898)
	at android.view.accessibility.AccessibilityManager$$ExternalSyntheticLambda1.run(Unknown Source:4)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:240)
	at android.os.Looper.loop(Looper.java:351)
	at android.app.ActivityThread.main(ActivityThread.java:8423)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

Activity

  1. dotnet-policy-service commented on Nov 19, 2025

    @dotnet-policy-service
    Contributor

    Hi @@semdelion! We have added the needs reproduction label to this issue, which indicates that we are unable to take further action until you provide a reproduction sample that we can use to reproduce + fix your bug. In accordance with the Reporting a bug section of our Contributing.md that you confirmed reading before you submitted this Issue, we ask that every Issue author provide a link to an open-source repository containing the reproduction sample app. This issue will be closed automatically in 5 days if we do not receive a reproduction sample from you. Please feel free to re-open this Issue once you have provided a reproduction sample.

  2. dotnet-policy-service commented on Nov 24, 2025

    @dotnet-policy-service
    Contributor

    This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 2 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

  3. dotnet-policy-service commented on Nov 26, 2025

    @dotnet-policy-service
    Contributor

    We haven't received a reproduction sample from you. The issue is closed.

  4. locked and limited conversation to collaborators on Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions