Unable to activate instance of type Syncfusion.SfPdfViewer

Hi,
I have an app that has a list view of the chapter of a pdf, so when user click on the list view, the app tries to PushModel a new model (imagine the name of the model is Book)
the Book page get the page number and load the document. 
The first time, when the user clicks on the list view to select the chapter, everything is fine, but after the user clicks the device's back button and clicks the new chapter, the app crashes with the following error :
Unable to activate instance of type Syncfusion.SfPdfViewer.XForms.Droid.SfPdfViewerEx from native handle 0xb2ef4a2c (key_handle 0x235f6b7b).'


Versions:
Syncfusion: 18.1.0.48
Xamarin.Forms: 4.6.0.726

Code:
ListView:

private async void SfListView_OnItemTapped(object sender, ItemTappedEventArgs e)
        {
            var chapterInfo = e.ItemData as ChapterInfo;
            int pageNumber = 1;
            if (chapterInfo != null)
            {
                pageNumber = chapterInfo.GetChapterPage();
            }
            await this.Navigation.PushModalAsync(new WholeBook(pageNumber));
        }

WholeBook:
[XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class WholeBook : ContentPage
    {
        private readonly int _pageNumber;
        
        public WholeBook(int pageNumber)
        {
            _pageNumber = pageNumber;
            InitializeComponent();
            PdfViewerControlPdfViewer.AllowHyperlinkNavigation = true;
            PdfViewerControlPdfViewer.Toolbar.Enabled = false;
        }


        protected override void OnAppearing()
        {
            base.OnAppearing();
            if (PdfViewerControlPdfViewer.PageCount == 0)
                PdfViewerControlPdfViewer.LoadDocument(ResourceHandler.GetResourceStream("test.pdf"));

            PdfViewerControlPdfViewer.PageNumber = _pageNumber;
        }
        protected override void OnDisappearing()
        {
            base.OnDisappearing();
            Navigation.PopModalAsync();
        }

    }

2 Replies

AV Ashokkumar Viswanathan Syncfusion Team May 11, 2020 08:48 AM UTC

Hi Siyavash, 
 
Greetings from Syncfusion, 
 
We were able to reproduce the issue, “Application crashes with unable to active instance exception in Android platform”. Currently, we are validating the issue and we will update the further details on 13th May 2020. 
 
Regards, 
Ashok Kumar Viswanathan. 



AV Ashokkumar Viswanathan Syncfusion Team May 13, 2020 01:45 PM UTC

Hi Siyavash, 
 
The issue, “Application crashes with unable to active instance exception in Android platform” has been resolved in our 2020 Volume 1 service pack Release v18.1.0.52. Kindly upgrade to the mentioned version to get the issue resolved. 
 
 
Regards, 
Ashok Kumar Viswanathan. 


Loader.
Up arrow icon