Skip to content

[BUG] System.NotSupportedException When using CommunityToolkit's Popup #2381

Closed

Description

@sato0826

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

I am developing an iOS application with .NET MAUI. I am using the CommunityToolkit.Maui Popup to achieve the following:

  1. Calendar Item: Display a calendar in a popup when an item is selected.
  2. Dropdown Selection Item: Display a dropdown in a popup.

I am trying to publish this application and use it on an iPad. After pairing my Windows PC and Mac PC, I installed the app built in release mode on the iPad. When I tested the app, it crashed with a "System.NotSupportedException" when I touched the item with the popup applied. It works fine when running in debug mode.

Could you please assist in identifying the cause?

Expected Behavior

Expected Behavior:The item is a button, so when the item is tapped, a popup is displayed.

Steps To Reproduce

1.Open and run solution fron reproduction repository
2.Click the "Go to NewPage1" button
3.Select an item
※However, it works correctly in debug mode.

Link to public reproduction project repository

https://github.com/sato0826/MauiPopupProgram

Environment

- .NET MAUI CommunityToolkit.Maui:9.1.1
- CommunityToolkit.Mvvm:8.3.2
- Plugin.Maui.Calendar:1.2.3
- iOS Target:net8.0

Anything else?

No response

Activity

  1. vhugogarcia commented on Dec 18, 2024

    @vhugogarcia
    Contributor

    Thanks @sato0826 for reporting the issue. However, the error exception you are sharing with us is very generic. On release mode, it is hard to identify an issue due to the exceptions are not very good showed on the console of Visual Studio.

    Could you please share the stack trace maybe using a FREE service like Sentry? https://sentry.io/welcome/

    Sentry may be able to help you to get more insights about the issue, and if you could post as much details as possible, would be fantastic.

  2. sato0826 commented on Dec 19, 2024

    @sato0826
    Author

    The StackTrace recorded in Sentry is as follows:

    System.NotSupportedException: Arg_NotSupportedException ?, in object PopupHandler.CreatePlatformElement() ?, in object ElementHandler<IPopup, object>.OnCreatePlatformElement() ?, in void ElementHandler.SetVirtualView(IElement view) ?, in void Element.SetHandler(IElementHandler newHandler) ?, in void Element.set_Handler(IElementHandler value) ?, in IElementHandler ElementExtensions.ToHandler(IElement view, IMauiContext context) ?, in void PopupExtensions.CreatePopup(Page, Popup) ?, in Task<object> PopupExtensions.CreateAndShowPopupAsync<PopupCalendar>(Page, PopupCalendar, CancellationToken) ?, in Task<object> PopupExtensions.ShowPopupAsync<PopupCalendar>(Page, PopupCalendar, CancellationToken) ?, in async Task SearchPage.<DateButtonFrom_Clicked>b__20_0(?)+(?) => { } ?, in async void SearchPage.DateButtonFrom_Clicked(object sender, EventArgs e) ?, in void Runtime.ThrowException(IntPtr) ?, in int UIApplication.UIApplicationMain(int, string[], IntPtr, IntPtr) ?, in void UIApplication.Main(string[], Type, Type) ?, in void Program.Main(string[] args)

  3. ne0rrmatrix commented on Jan 30, 2025

    @ne0rrmatrix
    Member

    We do not support dotnet 8.x. Our current support is for dotnet 9.x with the Maui Community toolkit. My suggestion is update to dotnet 9 and try latest toolkit which is 11.0 now. Please reply back if that fixes your issue.

  4. VladislavAntonyuk commented on Feb 3, 2025

    @VladislavAntonyuk
    Contributor

    It should be fixed with Popup V2, #1581

  5. locked and limited conversation to collaborators on May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/viewsIssue/Discussion/PR that has to do with ViewsbugSomething isn't workingunverified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions