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

Exception on iOS .Net 9 #145

Open
trondwa opened this issue Dec 2, 2024 · 4 comments
Open

Exception on iOS .Net 9 #145

trondwa opened this issue Dec 2, 2024 · 4 comments

Comments

@trondwa
Copy link

trondwa commented Dec 2, 2024

The49 BottomSheet has worked just fine in my MAUI project using .Net 8 on both iOS and Android for several months.
Last week I upgraded to .Net 9. The BottomSheet works as before on Android. However, on iOS I get an exception. I've tried to create an empy project only with this controller as well, but still no luck.

My code:

        var page = new BottomPage();

        page.HasBackdrop = true;
        page.CornerRadius = 10;

        var detent = new RatioDetent
        {               
            Ratio = 0.5F,
            BindingContext = page,
            IsEnabled = true,
            IsDefault = true
        };
        page.Detents.Add(detent);

        try
        {
            page.ShowAsync(Window);   //The exception happens here
        }
        catch (Exception ex)
        {

            throw;
        }

Exception: Object reference not set to an instance of an object.

Stacktrace:
at The49.Maui.BottomSheet.BottomSheetHandler.PlatformMapSelectedDetent(BottomSheet view)
at The49.Maui.BottomSheet.BottomSheetHandler.MapSelectedDetent(BottomSheetHandler handler, BottomSheet view)
at Microsoft.Maui.PropertyMapper2.<>c__DisplayClass5_0[[The49.Maui.BottomSheet.BottomSheet, The49.Maui.BottomSheet, Version=8.0.4.0, Culture=neutral, PublicKeyToken=null],[The49.Maui.BottomSheet.BottomSheetHandler, The49.Maui.BottomSheet, Version=8.0.4.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v) at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView) at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView) at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view) at Microsoft.Maui.Handlers.ViewHandler2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
at Microsoft.Maui.Handlers.ContentViewHandler.SetVirtualView(IView view)
at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
at Microsoft.Maui.Controls.VisualElement.set_Handler(IViewHandler value)
at The49.Maui.BottomSheet.BottomSheet.ShowAsync(IWindow parent, Boolean animated, Boolean aboveEverything)
at Skandia.BottomSheetTest.Pages.MainPage.Button_Clicked(Object sender, EventArgs e) in C:\Source\Skandia.BottomSheetTest\Pages\MainPage.xaml.cs:line 35

Anyone experiencing the same? Someone with a solution?

@imadofficial
Copy link

Yes, i'm experiencing the same issues.

@trondwa
Copy link
Author

trondwa commented Dec 2, 2024

Yes, i'm experiencing the same issues.

Ok. And I assume you didn't find a solution? Too bad as I really like the Bottomsheet component.

@imadofficial
Copy link

Not really, i'm currently experimenting with https://github.com/softlion/The49.Maui.BottomSheet to see if i can get it to work somehow

@trondwa
Copy link
Author

trondwa commented Dec 2, 2024

Not really, i'm currently experimenting with https://github.com/softlion/The49.Maui.BottomSheet to see if i can get it to work somehow

Let me know if you make it :)
Looked briefly at the isses on that one and unfortunately it seems like there's trouble with iOS there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants