I am using .NET MAUI 10 with CommunityToolkit.Maui.
I previously used CommunityToolkit.Maui v9.1.1, and in that version, I could open a popup from another popup without any issues. After upgrading to CommunityToolkit.Maui 13.0.0 and migrating all my popup code to Popup v2, I started experiencing crashes on Android.
Scenario:
I open Popup A.
Inside Popup A, there is a button that opens Popup B using ShowPopupAsync.
Popup B opens correctly, but when I close Popup B using CloseAsync(result), the app crashes on Android with the following exception:
Android.Runtime.JavaProxyThrowable
Minimal example:
// Popup A
public partial class PopupA : Popup
{
public PopupA() => InitializeComponent();
private async void OpenPopupB_Clicked(object sender, EventArgs e)
{
var popupB = new PopupB();
var result = await this.ShowPopupAsync(popupB);
Console.WriteLine($"Popup B result: {result}");
}
}
// Popup B
public partial class PopupB : Popup
{
public PopupB() => InitializeComponent();
private async void CloseButton_Clicked(object sender, EventArgs e)
{
await CloseAsync("Ok"); // Crash occurs here
}
}
Additional Information:
I have fully updated my popup code to comply with Popup v2 migration guidelines.
The crash only occurs on Android, and only when opening a popup from another popup.
This scenario was working perfectly in v9.1.1.
My questions:
Is opening a popup from another popup officially supported in CommunityToolkit.Maui v13.0.0?
Are there any known issues or workarounds for this Android crash?
What is the recommended way to handle nested popups in the latest MAUI + Toolkit versions?
Thank you for any guidance or insights!