[Bug] NullReferenceException in DragAndDropGestureHandler.<OnLongPress> on Android #14552
Comments
Could you attach a small sample where reproduce the issue?. Thanks. |
@jsuarezruiz: here's a repro project. Can't reproduce in emulator, but was able to reproduce with a debug build on a physical device. Just drag and drop items around until you see a NullReferenceException here:
|
@jsuarezruiz: will that fix be released in an SR at some point? Thanks. |
@mfeingol, a PR (#14634) for this is open now, would you be able to grab the NuGet as described here and let us know if this fixes this issue? That will greatly speed up the review process. Besides verifying if this particular issue is fixed also be sure to check other scenarios in the same area to make sure that this fix doesn't accidentally has side-effects 🙂 Thanks! |
Thanks, @jfversluis. I updated to 5.0.0.7867 from the PR feed and I was unable to repro the crash or any other issues with drag and drop in the context I discussed above. So I think we can call it a fix. I guess it would be nice if the ListView scrolled when I drag something to the top or bottom of it. But that's a different conversation. :-) |
Perfect, thanks for letting us know! Haha that is indeed a different conversation. On the other hand... Is that something the OS typically does? I'm now thinking of how iOS has implemented drag & drop OS wide. They also expect you to use 2 fingers and even drag & drop across different apps and such. Does dragging and scrolling up manually work? Anyway, definitely something to think about here. Thanks for working together with us on this one! |
Description
NullReferenceException inside Xamarin.Forms when using a DragGestureRecognizer. I believe this is a regression, possibly in the latest XF release, but I'm not 100% sure.
Steps to Reproduce
Expected Behavior
No exceptions thrown.
Actual Behavior
NullReferenceException inside Xamarin.Forms. I haven't been able to reproduce this in a debugger, but it's easy with a release build on a phone. This is the stack trace:
DragAndDropGestureHandler.b__19_0 (Xamarin.Forms.DragGestureRecognizer rec)
DragAndDropGestureHandler.SendEventArgs[TRecognizer] (System.Action`1[T] func, Xamarin.Forms.View view)
DragAndDropGestureHandler.OnLongPress (Android.Views.MotionEvent e)
IOnGestureListener.OnLongPress (Android.Views.MotionEvent e)
GestureDetector+IOnGestureListenerInvoker.n_OnLongPress_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e)
(wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.164(intptr,intptr,intptr)
Basic Information
Environment
Microsoft Visual Studio Enterprise 2019
Version 16.11.2
VisualStudio.16.Release/16.11.2+31624.102
Microsoft .NET Framework
Version 4.8.04084
Xamarin 16.11.000.174 (d16-11@e8f56f1)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 16.11.0.17 (remotes/origin/11e0001f0b17269345e80b58fb3adf1ba4efe2cd@11e0001f0)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 16.10.5 (355b57a)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 11.4.0.5 (d16-11/7776c9f)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: c633fe9
Java.Interop: xamarin/java.interop@48766c0
ProGuard: Guardsquare/proguard@912d149
SQLite: xamarin/sqlite@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools@683f375
The text was updated successfully, but these errors were encountered: