Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MR.Gestures ScrollView nullreference exception #10

Closed
japero opened this issue Feb 7, 2019 · 18 comments
Milestone

Comments

@japero
Copy link

@japero japero commented Feb 7, 2019

When using latest 2.1.0 version I get this error when using swipe in scrollview.
I reverted to 2.0.0 version and error disappears.
I saw similar error on earlier versions and commented over there also.

@MichaelRumpler

This comment has been minimized.

Copy link
Owner

@MichaelRumpler MichaelRumpler commented Feb 7, 2019

A little more information would be helpful.

When do you get the NRE? Do you have a stack trace? Can you send me a repro project?

@japero

This comment has been minimized.

Copy link
Author

@japero japero commented Feb 7, 2019

I can try to make simple demo app and see does it happen there also. But this appears in quite complex view taht has multiple grids and labels in use. I have this MR.Gestures.ScrollView that holds grid inside with label etc. I have Swiped event registered in xaml.
I cannot get stack trace because error happens inside your component? Vs2017 shows only this NullReference exception and app crashes. I have break point in event handler but that is never reach.

@MichaelRumpler

This comment has been minimized.

Copy link
Owner

@MichaelRumpler MichaelRumpler commented Feb 7, 2019

Even if it happens within MR.Gestures you should still get a StackTrace, just without line numbers. It should be written to the output window.

With what you provided I don't even know where to start. So please send me a repro project so that I can debug it.

The platform would help too.

@japero

This comment has been minimized.

Copy link
Author

@japero japero commented Feb 7, 2019

@japero

This comment has been minimized.

Copy link
Author

@japero japero commented Feb 8, 2019

Hi,
I tested this with blank project and error didi not happen there. I will close this issue even though in our compnay project this NullReference exception occures after swipe effect. Must be some other component causing error. Below is all I can get from this error when it is happening.

02-08 09:24:53.265 D/ViewRootImpl@b6164bfMainActivity: ViewPostImeInputStage processPointer 0
02-08 09:24:53.272 D/Mono (27937): DllImport searching in: '__Internal' ('(null)').
02-08 09:24:53.272 D/Mono (27937): Searching for 'java_interop_jnienv_call_nonvirtual_long_method_a'.
02-08 09:24:53.272 D/Mono (27937): Probing 'java_interop_jnienv_call_nonvirtual_long_method_a'.
02-08 09:24:53.272 D/Mono (27937): Found as 'java_interop_jnienv_call_nonvirtual_long_method_a'.
Unhandled Exception:

System.NullReferenceException: Object reference not set to an instance of an object.

I reverted to 2.0.0 version because for some reason that I do not know error does not happen.
Sorry that I could not provide reason for this.

Thread finished: #21

@japero japero closed this Feb 8, 2019
@MichaelRumpler

This comment has been minimized.

Copy link
Owner

@MichaelRumpler MichaelRumpler commented Feb 8, 2019

These messages are not related to MR.Gestures at all. That's nothing which helps to locate the error.
You might be able to find more info in the device log.

@japero

This comment has been minimized.

Copy link
Author

@japero japero commented Feb 8, 2019

I thought so too. Very odd this error but I will try to locate reason for this. Thanks for fast responses!

@kiwicodemonkey

This comment has been minimized.

Copy link

@kiwicodemonkey kiwicodemonkey commented Oct 16, 2019

Am experiencing the same crash with Xamarin 3.6/Android 9.0/MR.Gestures 2.1.0. iOS works fine.
ContentPage contains MR.ScrollView which contains Vertical stacklayout.
Swiping outside scrollview works, but inside scrollview gives the following stack:

System.NullReferenceException
Object reference is not set to an instance of an object
at MR.Gestures.Android.EventArgs.AndroidEventArgsHelper.GetTouches (Android.Views.MotionEvent current) [0x00006] in :0
at MR.Gestures.Android.EventArgs.AndroidPanEventArgs..ctor (Android.Views.MotionEvent previous, Android.Views.MotionEvent current, MR.Gestures.PanEventArgs prevArgs, Android.Views.View view) [0x0003a] in :0
at MR.Gestures.Android.SimpleGestureListener.OnScroll (Android.Views.MotionEvent down, Android.Views.MotionEvent move, System.Single distanceX, System.Single distanceY) [0x00025] in :0
at Android.Views.GestureDetector+SimpleOnGestureListener.n_OnScroll_Landroid_view_MotionEvent_Landroid_view_MotionEvent_FF (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e1, System.IntPtr native_e2, System.Single distanceX, System.Single distanceY) [0x00019] in <266395aeef1642bab2007ca31686faf9>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.93(intptr,intptr,intptr,intptr,single,single)

@PaulVrugt

This comment has been minimized.

Copy link

@PaulVrugt PaulVrugt commented Nov 5, 2019

@MichaelRumpler please reopen this. We experience the exact same issue as @kiwicodemonkey

@MichaelRumpler

This comment has been minimized.

Copy link
Owner

@MichaelRumpler MichaelRumpler commented Nov 5, 2019

I cannot reproduce it. Send me a repro project and I will have a look at it.

@PaulVrugt

This comment has been minimized.

Copy link

@PaulVrugt PaulVrugt commented Nov 5, 2019

I cannot reproduce it either in a test case, but we have tens of crashes from customers in our app in production. We tried on several devices and are unable to reproduce it. Isn't the stacktrace enough info to deduce what's going wrong?

@MichaelRumpler

This comment has been minimized.

Copy link
Owner

@MichaelRumpler MichaelRumpler commented Nov 5, 2019

The stack trace tells me, that the current MotionEvent is null, but I don't know why. For the past five years it was not null. I need to debug that, so I need to reproduce it.

@PaulVrugt

This comment has been minimized.

Copy link

@PaulVrugt PaulVrugt commented Nov 6, 2019

@MichaelRumpler
I am now able to reproduce it in our application reliably by swiping around for a while in a mr scrollview below the contents in the scrollview. Please let me know if you can reproduce it like this. If not, i'll try to create a repro app

@PaulVrugt

This comment has been minimized.

Copy link

@PaulVrugt PaulVrugt commented Nov 7, 2019

@MichaelRumpler
I've created a repro project. The repro was very easy. Just run the android project, wait for it to load and swipe a bit below the blue bar

Don't be confused by the project name, it was originally a test project for something else ;)

CollectionViewSpacing.zip

@PaulVrugt

This comment has been minimized.

Copy link

@PaulVrugt PaulVrugt commented Nov 14, 2019

@MichaelRumpler any updates? Were you able to reproduce it with my repro project?

@MichaelRumpler

This comment has been minimized.

Copy link
Owner

@MichaelRumpler MichaelRumpler commented Nov 15, 2019

Yes, I could reproduce it and am looking into it now. Thanks for that repro project!

@MichaelRumpler MichaelRumpler added this to the 2.1.1 milestone Nov 18, 2019
@MichaelRumpler

This comment has been minimized.

Copy link
Owner

@MichaelRumpler MichaelRumpler commented Nov 19, 2019

Version 2.1.1 is now available on NuGet.

@PaulVrugt

This comment has been minimized.

Copy link

@PaulVrugt PaulVrugt commented Nov 19, 2019

Thanks, we'll try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.