This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 44338 - Displaying context action causes ArgumentNullException when another item's context actions are already displayed on iOS10.
Summary: Displaying context action causes ArgumentNullException when another item's co...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 44786 45124 45827 46404 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-15 00:06 UTC by balaz
Modified: 2016-11-16 17:43 UTC (History)
28 users (show)

See Also:
Tags: iOS ac
Is this bug a regression?: ---
Last known good build:


Attachments

Description balaz 2016-09-15 00:06:59 UTC
Situation is as follows:
I have a ListView with some items with context actions.
1) display context action of some item by swipe.
2) display context action of some other item or just touch another item.
3) Crash with ArgumentNullException Value cannot be null Parameter name: gestureRecognizer.

I was working with iOS9 device and everything worked fine. I tried this on iOS 10 simulator and the crash occured. Afterwards I updated my device to iOS10 to verify if it crashed only on the simulator or with real device too. Result is it crashes also on iOS10 device. There must be some change between iOS 9 and iOS 10 which results in this crash. I used most recent stable xamarin forms - 2.3.2.127

It is possible to prevent the crash by doing this.
1) display context action of some item by swipe.
2) swipe back to close the context actions.
3) display context action of another item by swipe.

This is not practical and currently the context actions are not usable since crash cannot be prevented.

Stack trace:
System.ArgumentNullException: Value cannot be null.
Parameter name: gestureRecognizer
  at UIKit.UIView.RemoveGestureRecognizer (UIKit.UIGestureRecognizer gestureRecognizer) [0x00041] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/src/build/ios/native/UIKit/UIView.g.cs:1424
  at Xamarin.Forms.Platform.iOS.ContextScrollViewDelegate.ClearCloserRecognizer (UIKit.UIScrollView scrollView) [0x00015] in <a6cd19dbb15f4cf7a888f95a192e4376>:0
  at Xamarin.Forms.Platform.iOS.ContextScrollViewDelegate+<>c__DisplayClass24_0.<WillEndDragging>b__0 () [0x00048] in <a6cd19dbb15f4cf7a888f95a192e4376>:0
  at UIKit.UIGestureRecognizer+ParameterlessDispatch.Activated () [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/src/UIKit/UIGestureRecognizer.cs:71
  at at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSend_IntPtr (intptr,intptr,intptr)
  at UIKit.UIView.RemoveGestureRecognizer (UIKit.UIGestureRecognizer gestureRecognizer) [0x00021] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/src/build/ios/native/UIKit/UIView.g.cs:1422
  at Xamarin.Forms.Platform.iOS.ContextScrollViewDelegate.ClearCloserRecognizer (UIKit.UIScrollView scrollView) [0x00032] in <a6cd19dbb15f4cf7a888f95a192e4376>:0
  at Xamarin.Forms.Platform.iOS.ContextScrollViewDelegate+<>c__DisplayClass24_0.<WillEndDragging>b__0 () [0x00048] in <a6cd19dbb15f4cf7a888f95a192e4376>:0
  at UIKit.UIGestureRecognizer+ParameterlessDispatch.Activated () [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/src/UIKit/UIGestureRecognizer.cs:71
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/src/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/src/UIKit/UIApplication.cs:63
  at MyShoppingList.iOS.Application.Main (System.String[] args) [0x00008] in /Users/balaz/XamarinProjects/MyShoppingList/iOS/Main.cs:17
Comment 1 Leo 2016-09-15 18:31:46 UTC
I am also having this problem on iOS 10. It is very frustrating. What is even worse is the fact that, if I use ContextActions on a ItemTemplate, my app simply freeze. My app is already on store and all users that upgraded to iOS 10 are seeing those freezes and it happen on simulator too (the app proccess goes to 100%). It I remove all ContextActions, the app works. My ListView have some pretty complex DataTemplate. This problem happen even if I use XF 2.3.2.127. On 9.3 it works fine.
Comment 2 Denis 2016-09-16 08:47:32 UTC
I also encountered this - is there no solution?
Comment 3 Xavier P 2016-09-19 15:44:18 UTC
I encounter the very same bug. Did some tests to ensure this was not my own code before seeking for this ticket. Very frustrating indeed.
Comment 4 Xavier P 2016-09-19 15:46:22 UTC
Forgot to say I'm still using XF 2.3.0.107 since I face another nastier bugs with 2.3.2.127.
Comment 5 Bright Lee 2016-09-25 14:54:03 UTC
same here~
Comment 6 Bright Lee 2016-09-29 13:18:39 UTC
Any workaround?
Comment 7 Joe Maier 2016-10-04 12:09:02 UTC
Same here with XF 2.3.2.127
Comment 8 Tom Nohs 2016-10-08 16:05:45 UTC
Has anyone figured out a work around yet?  I am in the same situation where my app freezes on iOS 10.0 in the simulator and iPhone 6 plus.  As with everyone else there are no issues running it on iOS 9.3 and lower.  One item I can add is that when running on iOS 10 simulator and when the app applies a deserialzed Jason Object to the listview.source the app freezes.  I never get to see the data although by using a break point I can see that the Jason object does have the data.  Looking through the Mac System logs I can see that there is some kind of security failure when I apply the Jason object.  

Here is the log entry:
SecTaskLoadEntitlements failed error=22

The application freezes and needs to be killed at this point. 

On iOS 9.3 simulator there are no log entries other than the initialization of the simulator.
Comment 9 E.Z. Hart 2016-10-10 16:02:01 UTC
You can repro this with the ListView Interactivity sample project: https://github.com/xamarin/xamarin-forms-samples/tree/master/UserInterface/ListView/Interactivity
Comment 10 E.Z. Hart 2016-10-10 16:02:19 UTC
*** Bug 44786 has been marked as a duplicate of this bug. ***
Comment 11 Samantha Houts 2016-10-18 16:46:24 UTC
*** Bug 45124 has been marked as a duplicate of this bug. ***
Comment 12 Anthony 2016-10-20 22:23:20 UTC
+1 for having this issue...hopefully fix comes soon...
Comment 13 Benjamin Krämer 2016-10-22 11:32:52 UTC
+1 here
Comment 14 dreifuss 2016-10-23 06:31:43 UTC
+1 :(
Comment 15 Paul DiPietro [MSFT] 2016-10-24 17:32:13 UTC
*** Bug 45827 has been marked as a duplicate of this bug. ***
Comment 16 Slava Chernikoff 2016-10-25 08:51:37 UTC
+1. Need this fix to release an app.
Comment 17 Slava Chernikoff 2016-10-31 13:04:00 UTC
It's very annoying bug. Are there any way to prioritize fixing?
Comment 18 sh.naz 2016-10-31 21:43:19 UTC
I too experience this issue.

All I have to do is tapping on any other cell than the one whose context actions are visible and then crash and burn. Very critical.
Comment 19 Paul DiPietro [MSFT] 2016-11-03 22:34:22 UTC
*** Bug 46404 has been marked as a duplicate of this bug. ***
Comment 20 Rainer 2016-11-08 07:54:16 UTC
+1
Comment 21 Bright Lee 2016-11-08 08:23:49 UTC
I believe this issue is fixed on XF 2.3.3 pre-4.
It's working fine now for me.
Comment 22 Paul DiPietro [MSFT] 2016-11-08 16:53:36 UTC
This is indeed fixed as of 2.3.3-pre4.

Note You need to log in before you can comment on or make changes to this bug.