I don't know which part of my app requires an Material design but this is what I do to fix this crash:
- In Platform/Android/Resources/values added styles.xml and inside added this code:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="AppTheme" parent="Theme.MaterialComponents.Light.Bridge">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
- Make
styles.xml Build Action AndroidResource
- In
AndroidManifest.xml in the <manifest> tag added this lines of code:xmlns:tools="http://schemas.android.com/tools" android:theme="@style/AppTheme" tools:replace="android:theme"
- In
MainActivity.cs replace the Theme attribute property like this:
[Activity(Theme = "@style/AppTheme"....)]
All this changes fixed my problem with the Java.Lang.IllegalArgumentException
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]