Object reference not set when clicking on Editor text field

When running an SfChat app on an iOS 15 device I get the following null pointer exception when clicking on the Editor text (not able to type anything, getting an exception right away):


Object reference not set to an instance of an object.

at Syncfusion.ListView.XForms.iOS.ExtendedScrollViewRenderer.LayoutSubviews () [0x000ce] in :0

at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)

at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:69

at EssentialUIKit.iOS.Application.Main (System.String[] args) [0x00001]


I can't unfortunately send the whole project but I'd suggest just setting a try-catch block (or check for nulls) in your iOS.ExtendedScrollViewRenderer.LayoutSubviews () method. But I attach my chat xaml file.


Thanks, Vassili
P.S: I'm using SfChat and other widgets with the 19.3.0.54 version and Xamarin Forms 5.0.0.2125.
The issue is resolved if I downgrade to 19.2.0.62 version.
P.P.S. I figured out that the last version when there is no exception is 19.3.0.44. Starting from 19.0.3.45 there is a crash that I can't catch.


Attachment: ChatPage.xaml_ca0d76d.zip


10 Replies

SV Suja Venkatesan Syncfusion Team November 22, 2021 01:33 PM UTC

Hi Vassili, 

Thank you for contacting Syncfusion support. 

We have checked the reported issue “Object reference not set when clicking on Editor text field” with provided code snippet in our end. But unfortunately we are unable to reproduce the reported issue in our end. The sample we have used to check the reported issue is available in the following link for your reference. 


Please have a look at this sample and let us know if have missed any customization you have done in your application or revert us with modified sample and device detail in which you have faced the reported issue. It will be more helpful for us to find the exact cause for the issue and provide the prompt solution at earlier. 

Additional information:  
Tested device: Visual studio simulator iPhone 8 
iOS version: 15.0  
Xamarin.Forms Version: 5.0.0.2012.  
SfChat version: 19.3.0.45 & 19.3.0.54(recent version) 

Regards, 
Suja. 



VA Vassili replied to Suja Venkatesan November 22, 2021 08:58 PM UTC

Hi Suja,


You used an emulator. The problem is that I also have not been able to repro it with an emulator,  only with a real device.

But... you don't have to reproduce it - can you just catch the exception or check an object for null? This is a very recent code modification on your end, right after 19.0.3.44 ... I hope the code inside of

Syncfusion.ListView.XForms.iOS.ExtendedScrollViewRenderer.LayoutSubviews ()

is not that large to figure out where the problem occurs?


Thanks, 



SV Suja Venkatesan Syncfusion Team November 23, 2021 03:25 PM UTC

Hi Vassili, 

Thanks for the update. 

We have checked the reported issue “Object reference not set when clicking on Editor text field” in our end. Based on the provided stack trace we have added possible null checks and generated new custom assemblies from a private build, which you can download from the link below,  


The assemblies should be replaced with the existing assemblies in the following location.                                
{Syncfusion Installed location}\Essential Studio\19.3.0.54\Xamarin\lib\pcl\Syncfusion.SfListView.XForms.dll                                           
{Syncfusion Installed location}\Essential Studio\19.3.0.54\Xamarin\lib\android\Syncfusion.SfListView.XForms.dll                                        
{Syncfusion Installed location}\Essential Studio\19.3.0.54\Xamarin\lib\android\Syncfusion.SfListView.XForms.Android.dll                                
{Syncfusion Installed location}\Essential Studio\19.3.0.54\Xamarin\lib\iOS\Syncfusion.SfListView.XForms.dll                                        
{Syncfusion Installed location}\Essential Studio\19.3.0.54\Xamarin\lib\iOS\Syncfusion.SfListView.XForms.iOS.dll                                
{Syncfusion Installed location}\Essential Studio\19.3.0.54\Xamarin\lib\uwp\Syncfusion.SfListView.XForms.dll                                        
{Syncfusion Installed location}\Essential Studio\19.3.0.54\Xamarin\lib\uwp\Syncfusion.SfListView.XForms.UWP.dll                                 
                                      
Disclaimer : Please note that we have created these assemblies for the version 19.3.0.54 and Xamarin.Forms version 5.0.0.2125 specifically to resolve the query requested in this incident. Could you please check with the above assemblies which resolves the reported issue?   

Regards, 
Suja. 



VA Vassili November 24, 2021 01:51 AM UTC

Hi Suja,


Where is {Syncfusion Installed location} on a Mac?


Thanks, Vassili



SV Suja Venkatesan Syncfusion Team November 24, 2021 12:22 PM UTC

Hi Vassili, 

We regret for the inconvenience.  

We would like to let you know that you can add the Custom DLL as manual reference in your application. Please follow the below steps for adding custom DLL. 

  • Extract the custom DLL which we updated in our previous update.
  • Uninstall the Nuget package(i.e. Syncfusion.Xamarin.Chat)
  • Add the custom assemblies as manual references from the Custom DLL folder.

Please refer the following documentation link for applying custom assembly. 

Please let us know, if you have any concern in it. 

Regards, 
Suja. 



VA Vassili November 25, 2021 12:12 AM UTC

Hi Suja,


I did as you instructed... and unfortunately I'm still getting the crash....

I'm running it in Debug mode on a real device (iPhone XS on iOS 15).  Not only can't I repro it on an emulator, but also it's not easy to repro it on a device. There is only one chat dialog where I get a 100% repro (it's fine with other dialogs (unfortunately)). And, as mentioned, all is also fine as soon as I downgrade the Syncfusion version.

My suggestion is the following: could you provide me with another custom dll, but having maybe more print-outs (I would be able to see them in the application output in my VS for Mac and send them to you), or any other sort of messages to be able to get to the problem (even pop-up dialogs, etc.?


Thanks, Vassili





SV Suja Venkatesan Syncfusion Team November 25, 2021 12:30 PM UTC

Hi Vassili, 

Thanks for the update. 

We would like to let you know that we have provided Custom DLL with all possible null check based on the exception call stack. Please ensure whether custom DLL is referred or still nuget is referring in your application. It is not possible to find the exact cause and fix for the issue only with the provided call stack, as you mentioned the issue occurs only in a specific chat dialog. We are unclear about this “There is only one chat dialog where I get a 100% repro (it's fine with other dialogs (unfortunately))” which you mentioned in your last update. Please share the below requested detail to proceed further in this.   

  • Xaml and C# code snippets in your application related to SfChat.
  • Video/Image illustration of the reported issue.

Kindly share all the above requested details. It will be more helpful for us to understand the exact problem and to provide the prompt solution at earlier.  

Regards, 
Suja


VA Vassili November 27, 2021 12:20 AM UTC

Hi Suja,


I'm sorry, I was wrong. After complete cleaning and re-building I can confirm indeed that your fix works.

I don't have crashes anymore if I use your custom version of SfListView in 19.0.3.54.

As soon as I change your custom version back to the official one, I always get crashes.

Hopefully your custom version makes it soon into a new release.


Thanks a lot,

Vassili



SV Suja Venkatesan Syncfusion Team November 29, 2021 01:56 PM UTC

Hi Vassili, 

We are glad to know that the reported problem has been resolved at your end. We will include this include the fix in our upcoming weekly NuGet which is scheduled on December 7,2021. We will let you know once it is released with the fix. We appreciate your patience until then. 

Regards, 
Suja. 



SV Suja Venkatesan Syncfusion Team December 7, 2021 04:34 PM UTC

Hi Vassili, 

We have included the fix for the issue “Object reference not set when clicking on Editor text field” in our latest Weekly Nuget release update version 19.3.0.57 which is available for download  (https://www.nuget.org/).    
 
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance. 

Regards,  
Suja 


Loader.
Up arrow icon