AvaloniaUI / AvaloniaMauiHybrid

Brings templated controls, pixel perfect rendering, animations, styling and composition to Maui
MIT License
175 stars 13 forks source link

Java.Lang.IllegalArgumentException when try the sample #18

Closed AlleSchonWeg closed 7 months ago

AlleSchonWeg commented 7 months ago

Hi, i'm going to the readme: https://github.com/AvaloniaUI/AvaloniaMauiHybrid#embedding-maui-controls-inside-of-the-avalonia-app but when i start the android app i get an exception:

Java.Lang.IllegalArgumentException: 'The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).'

If i comment out the maui button the project works:

AvaloniaApplication1.zip

maxkatz6 commented 7 months ago

Some default MAUI controls require MaterialComponents theme to be applied in the app. You can edit what theme is used in your app:

Change your styles.xml like this:

<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.DayNight.NoActionBar">

to

<style name="MyTheme.NoActionBar" parent="Theme.MaterialComponents.DayNight.NoActionBar">
maxkatz6 commented 7 months ago

Updated readme instruction. Thank you for noticing it.