Julian Schmuckli Julian Schmuckli - 4 months ago 73
Android Question

android: Resources referenced from the manifest cannot vary by configuration

I writing a assistant application for Android. Now when I want to insert the follow meta-tag I became an error:

<meta-data
android:name="com.android.systemui.action_assist_icon"
android:resource="@mipmap/ic_launcher" />


Error Message:


Resources referenced from the manifest cannot vary by configuration
(except for version qualifiers, e.g. -v21.) Found variation in hdpi,
mdpi, xhdpi, xxhdpi, xxxhdpi


How can i fix this? Thanks for every response

Julian

Answer

Variation of resources in AndroidManifest.xml is detected as error.

It may be ignored like this:

<?xml version="1.0" encoding="utf-8"?>
<manifest ...
          xmlns:tools="http://schemas.android.com/tools"
          ...>

    ...

    <meta-data
            android:name="com.android.systemui.action_assist_icon"
            android:resource="@mipmap/ic_launcher"
            tools:ignore="ManifestResource" />

   ...

</manifest>

see: Android : Facebook app id showing error in values-ta/strings.xml and can't able to generate signed apk