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

Java.Lang.IllegalArgumentException when try the sample #18

Closed
AlleSchonWeg opened this issue Feb 27, 2024 · 2 comments
Closed

Java.Lang.IllegalArgumentException when try the sample #18

AlleSchonWeg opened this issue Feb 27, 2024 · 2 comments

Comments

@AlleSchonWeg
Copy link

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:

<mauiControls:Button Text="Maui Button" />

AvaloniaApplication1.zip

@maxkatz6
Copy link
Member

maxkatz6 commented Mar 7, 2024

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
Copy link
Member

maxkatz6 commented Mar 7, 2024

Updated readme instruction. Thank you for noticing it.

@maxkatz6 maxkatz6 closed this as completed Mar 7, 2024
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