After installing BarcodeScanner.Mobile version 8.0.0.1 I get this exception when the application starts: MAUI Java.Lang.IllegalArgumentException: 'This component requires that you specify a valid TextAppearance attribute. Update your app theme to inherit from Theme.MaterialComponents (or a descendant).'
Does anyone got the same experience?
I don't know which part of my app requires an Material design but this is what I do to fix this crash:
<?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>
styles.xml
Build Action AndroidResource
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"
MainActivity.cs
replace the Theme
attribute property like this:
[Activity(Theme = "@style/AppTheme"....)]
All this changes fixed my problem with the Java.Lang.IllegalArgumentException