SfMaskedEdit crashes on iOS when losing focus

Hello

I am using Syncfusion.Xamarin.Forms 18.3.0.42.

I have an application with some (complex) forms, that have some SfMaskedEdit controls.
Since I updated to Syncfusion.Xamarin.Forms 18.3.0.42, I noted that the application crashes sometimes when the SfMaskedEdit loses focus. Sometimes it happens when the control loses focus the first time, sometimes after the 5th time, sometimes even later.

There were no changes to my code, I only updated the Syncfusion nuget packages from 17.4.0.50 (with this version, the same code still works).
This only happens on iOS, on UWP, the exact same code works perfectly fine. It occurs on devices/simulators running iOS 14, as well as 14.1 (I did not try older iOS versions).

Could you please have a look at this?

Here is the stack trace from the crash:

System.NullReferenceException: Object reference not set to an instance of an object
  at Syncfusion.iOS.MaskedEdit.SfMaskedEdit.MaskedEditText_Ended (System.Object sender, System.EventArgs e) [0x00121] in <9d765babef464d70a4528f2225a8aaee>:0 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_EventArgs(object,System.EventArgs)
  at UIKit.UITextField+_UITextFieldDelegate.EditingEnded (UIKit.UITextField textField, UIKit.UITextFieldDidEndEditingReason reason) [0x00024] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/UIKit/UITextField.cs:90 
  at (wrapper managed-to-native) ObjCRuntime.Messaging.bool_objc_msgSend_bool(intptr,intptr,bool)
  at UIKit.UIView_UITextField.EndEditing (UIKit.UIView This, System.Boolean force) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/UIKit/UIView_UITextField.g.cs:61 
  at Xamarin.Forms.Platform.iOS.PageRenderer.<ViewDidLoad>b__43_0 (UIKit.UITapGestureRecognizer a) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:226 
  at UIKit.UITapGestureRecognizer+Callback.Activated (UIKit.UITapGestureRecognizer sender) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/UIKit/UIGestureRecognizer.cs:220 
  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 /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at MyProject.iOS.Application.Main (System.String[] args) [0x00002] in D:\.Net\PolicePad\MyProject\MyProject.iOS\Main.cs:15 


Kind regards
Phil

7 Replies 1 reply marked as answer

RS Ramya Soundar Rajan Syncfusion Team October 26, 2020 12:53 PM UTC

Hi Phil, 
 
Greetings from Syncfusion.  
   
We have checked the reported problem in a SfMaskedEdit sample by focusing and unfocusing the control multiple times but it’s working in our side.  
   
Configuration details:  
   
iOS version: 12 and 13.1  
Syncfusion version : 18.3.0.42  
Xamarin.Forms Version : 4.8  
   
Can you please share the following details?    
    
·       Can you please provide the replication demo video?  
·       If possible, could you please share the sample to replicate this issue or else share the code snippets    
·       Is it occurred with the specific devices or else to common? In addition, please share the used device name and version   
·       Whether adding the SfMaskedEdit control inside any parent view?

 
Note: Currently, we are in lock down, we don’t have a required 14 simulator version. So, we need a time to ensure it. Meanwhile please share the requested details mentioned above. This will be helpful for us to investigate further and provide you a better solution at the earliest.   
 
Regards, 
Ramya S 



UN Unknown October 30, 2020 03:09 PM UTC

Thank you for your reply.

Unfortunately, I was not able to reproduce the behavior in a simple project.
In my app there is quite some nesting of different controls, so it might be, that they interfere in some way.

I found a workaround by not using the SfMaskedEdit control anymore but instead using a normal Entry control.
Now it does not crash anymore and the functionality in my case is about the same.

Since you couldn't reproduce this on your side, there is nothing more to do here.


Thanks again for your help.


RS Ramya Soundar Rajan Syncfusion Team November 2, 2020 11:27 AM UTC

Hi Phil, 
               
Since we are unaware of your exact requirement, to reproduce the reported problem in our side. We have checked in all possible scenario and also in iOS version 14 but it’s working fine. However, we will check and include the possible null condition based on your provided stack trace in our weekly NuGet which is expected to be rolled out on November 10, 2020. We appreciate your patience until then. 
 
Regards, 
Ramya S 



RS Ramya Soundar Rajan Syncfusion Team November 5, 2020 01:28 PM UTC

Hi Phil, 
 
We have put some possible null check in our source based on the stack trace. Please find the custom assemblies from below with the version of 18.3.0.44.  
   
   
Assembly version: 18.3.0.44    
   
NoteRemove the existing DLL or NuGet from the project files from your project. And delete the package folder of the sample then refer the new assemblies. Please refer the KB for more reference, 
 
 
Can you please confirm whether the reported problem is resolved at your end? Based on your confirmation, we will include this fix in our upcoming weekly NuGet.  
  
Note: We were unable to reproduce it, based on the stack trace only we have provided the fix.  
 
Regards, 
Ramya S 



UN Unknown November 9, 2020 08:28 AM UTC

With the custom assemblies I was unable to reproduce the reported issue as well.
So I guess the changes that you've made fixed this issue.

Thank you very much for your help.


RS Ramya Soundar Rajan Syncfusion Team November 10, 2020 10:46 AM UTC

Hi Phil, 
  
Thanks for your confirmation. 
 
We will include this fix in our weekly NuGet which is expected to be rolled out on November 11, 2020. 
 
Regards, 
Ramya S 



RS Ramya Soundar Rajan Syncfusion Team November 11, 2020 07:01 AM UTC

Hi Phil, 
 
We are glad to announce that our weekly NuGet was rolled out and fix for the reported issue was included in the weekly NuGet. 
 
NuGet Version: 18.3.0.48
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Ramya S 


Marked as answer
Loader.
Up arrow icon