Description
I'm testing out embedding MAUI pages into a new .NET 6 Android-project using this guide. When I try to embed a page that contains a Button control it crashes with the following exception: Microsoft.Maui.Platform.ToPlatformException: 'Microsoft.Maui.Handlers.ButtonHandler found for Microsoft.Maui.Controls.Button is incompatible'. This happens at the following statement:
var view = myMauiPage.ToPlatform(mauiContext);
When I test the same thing on a .NET 6 iOS-project, it works fine.
Steps to Reproduce
- Create a File -> New "Android application" (.NET 6 template)
- Follow the guide to enable MAUI embedding in the Android project.
- Add a MAUI page to the project and add a Button to the page
- Try to call
.ToPlatform(context) on the new page
Version with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12
Did you find any workaround?
Had to comment out the Button.
Relevant log output
No response
Description
I'm testing out embedding MAUI pages into a new .NET 6 Android-project using this guide. When I try to embed a page that contains a Button control it crashes with the following exception:
Microsoft.Maui.Platform.ToPlatformException: 'Microsoft.Maui.Handlers.ButtonHandler found for Microsoft.Maui.Controls.Button is incompatible'. This happens at the following statement:When I test the same thing on a .NET 6 iOS-project, it works fine.
Steps to Reproduce
.ToPlatform(context)on the new pageVersion with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12
Did you find any workaround?
Had to comment out the Button.
Relevant log output
No response