Prism navigation in PopupView that is inside NavigationPage.TitleView causes the app to crash in Android

When I try to navigate using relative navigation it causes the app to crash, if using absolute layout it works nice.


There's a sample of the issue, I put a popup inside TitleView and another in ContentPage, the one in ContentPage works nice. A workaround is to put a button in TitleView that opens a Popup in ContentPage. Another very important thing is that in iOS it works with no problems.


Maybe another very important thing is that in old version this error doesn't happen at all, like 18.2.0.*


Relative navigation

NavigateAsync("MainPage");


Absolute navigation

NavigateAsync("/NavigationPage/MainPage");






Attachment: PopupWithPrism_a7d6938d.rar


7 Replies 1 reply marked as answer

SY Suthi Yuvaraj Syncfusion Team September 13, 2022 04:42 AM UTC

Hi Felipe,


We have checked the reported scenario from our end. We have encountered the below crash on the Android platform with SfPopupLayout version of 20.2.0.46 and Xamarin.Forms version as 5.0.0.2515.


We would like to know that it is the crash that you were facing. We have checked the stack trace and it is not from the SfPopupLayout control. To meet your requirements, we recommend that you navigate from popupview in viewmodel.cs to the main thread. We have attached the code snippet and workable sample for your reference.


Codesnippet:

 //In ViewModel.cs

private async void Navigate()

{

    IsPopupOpen = false;

    Device.BeginInvokeOnMainThread(async () =>

    await navigation_service.NavigateAsync("MainPage"));

} 


Also if we misunderstood your requirement please revert us with more crash details , stack trace and an illustration video or image to reproduce the issue. It will be more helpful for us to provide timely solutions.


Regards,

Suthi Yuvaraj.


Attachment: PopupWithPrism_dc5dfec8.zip


FE Felipe September 13, 2022 05:21 AM UTC

Strangely the error doesn't happen if using MainThread from Xamarin Forms, but if using

Xamarin.Essentials.MainThread.BeginInvokeOnMainThread the same error persist


Codesnippet:



private async void Navigate()

{

IsPopupOpen = false;

Xamarin.Essentials.MainThread.BeginInvokeOnMainThread(async () => {

await navigation_service.NavigateAsync("MainPage");

});

}



Another important thing is it works nice if I try to navigate with a button in TitleView, it only crash if there's a navigation button inside popupview that is inside TitleView


SY Suthi Yuvaraj Syncfusion Team September 13, 2022 02:52 PM UTC

Hi Felipe,


We are able to reproduce the reported crash with Xamarin.Essentials beginInvokeOnMainTheard() from our end. We are in need of two more working days to validate the issue and discussed it with the development team. We will update you with further details on or before September 16, 2022. We appreciate your patience until then.


Meanwhile, We encountered the crash in until nuget version 18.1.0.* as you mentioned issue is not reproduced in 18.2.0.*, Could please share the NuGet version of SfPopuplayout, in which the issue is not reproduced?


Regards,

Suthi Yuvaraj.



FE Felipe September 13, 2022 03:45 PM UTC

I was using SfPopupLayout version 18.2.0.46, for some reason I could reproduce the error in the sample, but it works on my app 



SY Suthi Yuvaraj Syncfusion Team September 16, 2022 02:05 PM UTC

Hi Felipe,


We have logged a bug report for the reported issue “Prism navigation in PopupView that is inside NavigationPage.TitleView causes the app to crash in Android". We will fix the issue and include the fix in our weekly nuget which is scheduled on October 11, 2022. We will let you know once it is released with the fix. Soon we will share the bug report to track the status of the issue. We appreciate your patience until then.


Regards,

Suthi Yuvaraj.




SV Suja Venkatesan Syncfusion Team September 19, 2022 06:10 AM UTC

Hi Felipe,


We would like to let you know that you can also track the status of the report from the below link.  


Feedback Link : https://www.syncfusion.com/feedback/37775/system-notsupportedexception-thrown-when-sfpopuplayout-is-load-inside-the


Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.


Regards,

Suja




SV Suja Venkatesan Syncfusion Team October 6, 2022 02:27 PM UTC

Hi Felipe,


We have fixed the reported issue “Prism navigation in PopupView that is inside NavigationPage.TitleView causes the app to crash in Android” and included the issue fix in our latest NuGet release update version 20.3.0.48 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 require any further assistance


Regards,

Suja


Marked as answer
Loader.
Up arrow icon