We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ArgumentNullException when using the unload method in the OnDisappearing event

When I leave my page, I use the OnDisappearing event to unload the PDF viewer control.
During this unload, I get an ArgumentNullException.
The error appears since versions 17.3.x.x
With version 17.2.0.51, I did not have a problem

Here is the stacktrace:
at UIKit.UIView.AddSubview (UIKit.UIView view) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIView.g.cs:268
at Syncfusion.SfPdfViewer.XForms.iOS.ScrollViewEx.RemoveIndicator () [0x00025] in <397ffd14fb724d0f887ac6b3c43e85e3>:0
at Syncfusion.SfPdfViewer.XForms.iOS.ScrollViewEx.ScrollToHorizontalOffset (System.Double horizontalOffset) [0x00008] in <397ffd14fb724d0f887ac6b3c43e85e3>:0
at Syncfusion.SfPdfViewer.XForms.iOS.PdfViewerDependencyService.ScrollToHorizontalOffset (System.Single horizontalOffset, System.Object nativeObject) [0x00008] in <397ffd14fb724d0f887ac6b3c43e85e3>:0
at Syncfusion.SfPdfViewer.XForms.SfPdfViewer.set_HorizontalOffset (System.Single value) [0x00026] in :0
at Syncfusion.SfPdfViewer.XForms.iOS.ScrollViewEx.ScrollViewEx_Scrolled (System.Object sender, System.EventArgs e) [0x0040e] in <397ffd14fb724d0f887ac6b3c43e85e3>:0
at UIKit.UIScrollView+_UIScrollViewDelegate.Scrolled (UIKit.UIScrollView scrollView) [0x0000a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIScrollView.g.cs:1632

Here is the code that generates the exception:
protected override void OnDisappearing()
{
base.OnDisappearing();
pdfViewerControl.Unload();
}

Characteristic of the project:
Xamarin.Forms 4.2.0.848062
Xamarin.iOS 13.4.0.2
.NET STandard 2.1

Is there a workaround to correct this ? 

Thanks.

3 Replies

JP Jhansi Priya Ramesh Syncfusion Team October 16, 2019 11:21 AM UTC

Hi Julien, 

We could able to reproduce the issue of “Exception occurs while unloading the PDF document” in Xamarin.Forms.iOS. We have forwarded this issue to our development team for further analysis and we will update further details on 18th October 2019. 

Regards, 
Jhansi Priya Ramesh 



JP Jhansi Priya Ramesh Syncfusion Team October 18, 2019 01:14 PM UTC

Hi Julien, 
 
We confirm that the issue “Exception occurs while unloading the PDF document” in Xamarin.Forms.iOS is a defect and logged defect report for the same. We will deliver fix for this issue on 8th November 2019. 
 
Regards, 
Jhansi Priya Ramesh 



JP Jhansi Priya Ramesh Syncfusion Team November 8, 2019 03:42 PM UTC

Hi Julien, 
 
The issue with "Exception occurs while unloading the PDF document" has been fixed and the patch for this fix can be downloaded from the following location.  
 
Recommended approach - exe will perform automatic configuration
 
Please find the patch setup from below location:
 
 

 
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment
 
Please find the patch assemblies alone from below location:
 
 
 
   
NuGet:   
 
 
Assembly Version: 17.3.0.26 
Installation Directions : 
 
This patch should replace the files “Syncfusion.SfPdfViewer.XForms.dll” and “Syncfusion.SfPdfViewer.XForms.iOS.dll”  under the following folder.
 
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6
 
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\9.3.0.61\precompiledassemblies\9.3.0.61\4.0
 
 
To automatically run the Assembly Manager, please check the Run assembly manager
 checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies. 
 
Note : 
 
You can change how you receive bug fixes by navigating to the following link and updating your preferences.
 
 
https://www.syncfusion.com/support/directtrac/patches 
 
Disclaimer : 
 
Please note that we have created this patch for version 17.3.0.26 specifically to resolve the following issue(s) reported in this/the Forum(s). 148326 
 
If you have received other patches for the same version for other products, please apply all patches in the order received.
 
This fix will be included in our 2019 Vol 4 release which will be available in December 2019.
 
 

 
Regards,  
Jhansi Priya Ramesh 


Loader.
Live Chat Icon For mobile
Up arrow icon