Error unloading document: 'removeAllViews() is not supported in AdapterView'

Hi,

I'have a xamarin form with a sfCombobox showing a list of pdf's. When one is selected a pdf is loaded. Everything correct till here.
The problem comes when I select another pdf. In that moment I unload the pdf and I try to load the new one. In that moment I get the error:

Java.Lang.UnsupportedOperationException
  Mensaje = removeAllViews() is not supported in AdapterView

This is the xaml code:
                <syncfusion:SfPdfViewer Toolbar = "{StaticResource ToolbarSettings}"   VerticalOptions="FillAndExpand" 
                                        AnnotationMode="None" BookmarkNavigationEnabled="False" x:Name="pdfViewerControl"                                        
                                        />
the c# code:

                ServiceWrapper sw = new ServiceWrapper();
                string pdf = await sw.GetPdfForm(AuthStore.Token, PageModel.SelectedItem.urlPart);
                if (!String.IsNullOrEmpty(pdf))
                {
                    if (DocumentLoaded)
                    {

                        pdfViewerControl.Unload();  //here I get the error

                    }

                    pdfViewerControl.LoadDocument(new MemoryStream(Convert.FromBase64String(pdf)));
                    DocumentLoaded = true;

                }


I'm using the 18.4.0.41 version (but I tried previous ones with same results)
Xamarin forms version: 5.0.0.1931

Thank you very much!


5 Replies 1 reply marked as answer

MK Muralitharan Karikalan Syncfusion Team February 8, 2021 05:38 PM UTC

Hi Enrique, 
 
Greetings from Syncfusion support 
 
we are unable to reproduce the issue, “Application crashes with exception while unload and loading the documents multiple times” from our end with the provided details. Could you please try the below-provided sample and let us know whether we have missed out anything while replicating the issue. 
 
Please find the sample in the below link, which we have used to reproduce the issue in our end 
 
Kindly share the following details to analyze more on this issue and assist you with the better solution   
1.Simple sample/ modify the above sample to reproduce the issue.  
2.Replication procedure/ Replication video. 
3.Stack trace 
 
Regards, 
Muralitharan K. 



EN Enrique February 9, 2021 12:03 PM UTC

Thank you very much for your help.

I finally found that the error is caused by the pdf I used to test.
I'm using a pdf form that loads ok, but when I unload is causing the error.
You can download the pdf to test by yourself here:


I don't know if it is an issue of the pdf or if the pdf component is not behaving correctly. I have now tested with other pdf forms and are working ok.

Have a good day!



MK Muralitharan Karikalan Syncfusion Team February 10, 2021 01:15 PM UTC

Hi Enrique, 
 
Thanks for your update, 
 
We were able to reproduce the issue, Application throws exception while unloading a particular document in SfPdfViewer in our end. Currently, we are validating the issue and we will update the further details on February 12, 2021. 
 
Regards, 
Muralitharan K 



MK Muralitharan Karikalan Syncfusion Team February 12, 2021 01:53 PM UTC

Hi Enrique,  
   
We have confirmed that the issue Application throws exception while unloading a particular document in SfPdfViewer is a defect and logged a defect report for this issue. The patch for this issue will be delivered on March 05 , 2021.  
  
Please find the feedback link below,  
   
Regards,  
Muralitharan K.  



MK Muralitharan Karikalan Syncfusion Team March 5, 2021 12:42 PM UTC

Hi Enrique,    
    
We have resolved the issues “Application throws exception while unloading a particular document in SfPdfViewer” and the custom NuGet for the same can be downloaded from the following link.    
        
Custom NuGet :  https://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomNuGetforum146844026.zip                                                                                                                                      
       
Disclaimer: Please note that we have created this NuGet for version 18.4.0.46 specifically to resolve the following issue(s) reported in this/the Forum 162259 
      
Note : Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.       
        
           
This fix will be included in our 2021 Volume 1 service pack release which is expected to available in the month of April, 2021.        
    
Regards,    
Muralitharan K.    
 


Marked as answer
Loader.
Up arrow icon