I used the UI to add an adaptive icon and I get this error:
Monochrome icon is not defined If android:roundIcon and android:icon are both in your manifest, you must either remove the reference to android:roundIcon if it is not needed; or, supply the monochrome icon in the drawable defined by the android:roundIcon and android:icon attribute. For example, if android:roundIcon and android:icon are both in the manifest, a launcher might choose to use android:roundIcon over android:icon to display the adaptive app icon. Therefore, your themed application iconwill not show if your monochrome attribute is not also specified in android:roundIcon. Issue id: MonochromeLauncherIcon
This error message is not clear and also not the way to fix it.
You probably have an adaptive launcher icon like:
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Google wants:
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
</adaptive-icon>
(along with a suitable ic_launcher_monochrome mipmap)
This is in support of the Material You initiative.
If, like many developers, your graphic designers and marketers think that Material You is utterly ridiculous, you can add tools:ignore="MonochromeLauncherIcon" to opt out of the Lint check:
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MonochromeLauncherIcon">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With