Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
sato0826 opened this issue Dec 12, 2024 · 2 comments
Open
2 tasks done
Labels
area/views Issue/Discussion/PR that has to do with Views bug Something isn't working unverified

Comments

@sato0826
Copy link

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

@sato0826 sato0826 added bug Something isn't working unverified labels Dec 12, 2024
@vhugogarcia
Copy link
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.

@vhugogarcia vhugogarcia added the area/views Issue/Discussion/PR that has to do with Views label Dec 18, 2024
@sato0826
Copy link
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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/views Issue/Discussion/PR that has to do with Views bug Something isn't working unverified
Projects
None yet
Development

No branches or pull requests

2 participants