Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
# Steps to reproduce
1- Create a Xamarin.Forms project.
2- Add an image or any view with a gesture recognizer that has two fingers, so PinchGestureRecognizer or PanGestureRecognizer with touchPoints = 2. You can do this in XAML or the code behind: it won't matter. Whether or not it's an image or another view or a custom renderer doesn't matter.
3- Implement the method or lambda function for PinchUpdated/PanUpdated, whether with actual code or just leave it empty and return: it won't matter.
4- Build the project and test it on a local machine, simulator, or device connected via USB.
5- Try to use the multi-touch gesture for a minute.
# Expected behavior
The two-finger gesture should trigger the event with whatever code you've added to it (could be no code at all), every time you use that gesture.
# Actual behavior
Within a minute at most of using the two-finger gesture a NullArgumentException is triggered, and here's the message, the same for both pan and pinch gesture recognizers:
System.NullReferenceException: Object reference not set to an instance of an object.\r\n
at Xamarin.Forms.Platform.UWP.VisualElementTracker`2.HandlePinch(ManipulationDeltaRoutedEventArgs e, View view)\r\n
at Xamarin.Forms.Platform.UWP.VisualElementTracker`2.OnManipulationDelta(Object sender, ManipulationDeltaRoutedEventArgs e)
# Test environment (full version information)
First I encountered this bug in my own shared project. I tried updating Xamarin.Forms to the latest stable version to no avail; so my Xamarin.Forms nuget is version: 22.214.171.1247; I had a previous version before which would also throw the exception.
Finally I created a new PCL Xamarin Forms project with a new UWP app template and added only an image with the two-finger gesture recognizers, and had the same issue.
I don't seem able to reproduce this on a new project using a PinchGestureRecognizer or using the PinchGesture sample project. Could you upload a reproduction and provide more detail on what you're running the project on, and if the issue occurs for you on the 2.4.0-pre1 build?
I've successfully reproduced the same problem with a copy of the Pinch Gesture solution you provided. Now I must say I'm roughing it up and not pinching/tapping/panning like the average user would. However the exception is thrown almost immediately on the simulator (much quicker if I zoom in and out then left click somewhere else on the image, but zooming in and out will eventually get me there as well.)
It takes a little longer on the ARM Windows 10 device connected via USB but still not that long if I pinch in and out on various parts of the image(again tapping with two fingers in between pinches makes it throw faster.)
I have tried updating to the 2.4 pre-build of Xamarin Forms in the Pinch Gesture project, and I'm encountering the same issue.
The computer I'm using to build the project (and run the simulator) is a MacBook Pro, with Windows 10 installed via BootCamp, and I'm building the project in Visual Studio 2017.
I don't think there is a point in me uploading other projects since I'm now using the Pinch Gesture demo to reproduce the problem, but I have recorded a screen capture of the simulator and the ARM device (via Project My Screen and the Xbox recording tool), as well as ones of Visual Studio throwing the exception.
The google drive folder with the videos:
Using Xamarin.Forms and Xamarin.Forms.Pages v126.96.36.19971-pre2 in my own NET Standard 1.4 project, I do not experience crashes as described above. However, the pinch gesture is not recognized on a Nokia 830 phone UWP ARM release build, while the debug build works fine. Pinch also works fine for UWP x64 and Android, both release and debug, on a laptop.
As no further comments regarding the original issue have been made, we are closing this as not reproducible. Please reopen this with a working reproduction that exhibits the issue if it occurs as of the latest 2.5.0 stable build.
Guidelines for creating reproductions are available at: