-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-controls-buttonButton, ImageButtonButton, ImageButtonarea-controls-dialogalertDisplayAlert, dialogDisplayAlert, dialogarea-themeThemes, themingThemes, themingpartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
Hello. I'm trying to open a popup on button click. But something went wrong and I get the following exception:


Steps to Reproduce
- Run the application from the repository.
- Click the 'Show me' button on the MainPage and you can see the exception.
if you replace the Button with the Label, the application works fine.
https://github.com/JaneySprings/MauiAndroidMaterialBug/blob/438e4b223e6e0ae9b9515ce6e791281edba402b8/MainPage.xaml.cs#L14
Link to public reproduction project repository
https://github.com/JaneySprings/MauiAndroidMaterialBug
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
29
Did you find any workaround?
If you replace the Button with a Label, it will work.
Relevant log output
[ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
F/mono-rt : at Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod(JniObjectReference instance, JniObjectReference type, JniMethodInfo method, JniArgumentValue* args) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:line 12324
F/mono-rt : at Java.Interop.JniPeerMembers.JniInstanceMethods.FinishCreateInstance(String constructorSignature, IJavaPeerable self, JniArgumentValue* parameters) in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods.cs:line 174
F/mono-rt : at Google.Android.Material.Button.MaterialButton..ctor(Context context) in /Users/runner/work/1/s/generated/com.google.android.material.material/obj/Release/net6.0-android/generated/src/Google.Android.Material.Button.MaterialButton.cs:line 385
F/mono-rt : at Microsoft.Maui.Platform.MauiMaterialButton..ctor(Context context) in D:\a\_work\1\s\src\Core\src\Platform\Android\MauiMaterialButton.cs:line 13
F/mono-rt : at Microsoft.Maui.Handlers.ButtonHandler.CreatePlatformView() in D:\a\_work\1\s\src\Core\src\Handlers\Button\ButtonHandler.Android.cs:line 27
F/mono-rt : at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IButton, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Google.Android.Material.Button.MaterialButton, Xamarin.Google.Android.Material, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].OnCreatePlatformView() in D:\a\_work\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 72
F/mono-rt : at Microsoft.Maui.Handlers.ViewHandler.OnCreatePlatformElement() in D:\a\_work\1\s\src\Core\src\Handlers\View\ViewHandler.cs:line 123
F/mono-rt : at Microsoft.Maui.Handlers.ElementHandler.CreatePlatformElement() in D:\a\_work\1\s\src\Core\src\Handlers\Element\ElementHandler.cs:line 101
F/mono-rt : at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view) in D:\a\_work\1\s\src\Core\src\Handlers\Element\ElementHandler.cs:line 50
F/mono-rt : at Microsoft.Maui.Handlers.ViewHandler.SetVirtualView(IElement element) in D:\a\_work\1\s\src\Core\src\Handlers\View\ViewHandler.cs:line 129
F/mono-rt : at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IButton, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Google.Android.Material.Button.MaterialButton, Xamarin.Google.Android.Material, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view) in D:\a\_work\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 53
F/mono-rt : at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IButton, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Google.Android.Material.Button.MaterialButton, Xamarin.Google.Android.Material, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view) in D:\a\_work\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 56
F/mono-rt : at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler) in D:\a\_work\1\s\src\Controls\src\Core\HandlerImpl\Element\Element.Impl.cs:line 69
F/mono-rt : at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value) in D:\a\_work\1\s\src\Controls\src\Core\HandlerImpl\Element\Element.Impl.cs:line 19
F/mono-rt : at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value) in D:\a\_work\1\s\src\Controls\src\Core\HandlerImpl\VisualElement\VisualElement.Impl.cs:line 303
F/mono-rt : at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context) in D:\a\_work\1\s\src\Core\src\Platform\ElementExtensions.cs:line 96
F/mono-rt : at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context) in D:\a\_work\1\s\src\Core\src\Platform\ElementExtensions.cs:line 127
F/mono-rt : at mauiTemplate.MainPage.Button_Clicked(Object sender, EventArgs e) in /Users/nromanov/Work/mauiTemplate/MainPage.xaml.cs:line 15Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-controls-buttonButton, ImageButtonButton, ImageButtonarea-controls-dialogalertDisplayAlert, dialogDisplayAlert, dialogarea-themeThemes, themingThemes, themingpartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working