-
Notifications
You must be signed in to change notification settings - Fork 1.9k
TapGestureRecognizer on GraphicsView causes a crash on Android devices #34296
Copy link
Copy link
Closed
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingi/regressionThis issue described a confirmed regression on a currently supported versionThis issue described a confirmed regression on a currently supported versionplatform/androidregressed-in-10.0.40s/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingi/regressionThis issue described a confirmed regression on a currently supported versionThis issue described a confirmed regression on a currently supported versionplatform/androidregressed-in-10.0.40s/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
A TapGestureRecognizer attached to a GraphicsView can cause an Android app to crash when the GraphicsView is tapped. This started to occur in Microsoft.Maui.Controls version 10.0.40 and occurs in 10.0.41 as well (version 10.0.31 worked fine).
It only seems to be an issue on physical Android devices (e.g. Samsung Galaxy A10 with Android 11, Nokia 310 with Android 10) and not on Android emulators. iOS devices and Windows seem unaffected by the issue.
Steps to Reproduce
Expected behaviour: the TapGestureRecognizer event handler should be called when the GraphicsView is tapped.
Actual behaviour: the app crashes.
Link to public reproduction project repository
https://github.com/Tim-Rasmussen/GraphicsViewTapGestureRecognizer.git
Version with bug
10.0.40
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
10.0.30
Affected platforms
Android
Affected platform versions
We've only been able to test on Android 11 and 10 devices but it may happen on later versions.
Did you find any workaround?
The workaround is to use the GrahicsView StartInteraction event in place of the TapGestureRecognizer but the latter event seems to fire later than the former which makes the workaround unusable in our commercial app which has GraphicsViews within a CollectionView (each CollectionView item has an attached TapGestureRecognizer which fires before the GraphicsView StartInteraction event but we need to intercept the GraphicsView being tapped).
Relevant log output