从清单引用的资源不能因配置而异 [英] Resources referenced from the manifest cannot vary by configuration

查看:259
本文介绍了从清单引用的资源不能因配置而异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想插入以下元标记时:

When I want to insert the follow meta-tag:

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

我收到错误消息:


清单引用的资源不能因配置
而异(版本限定符除外,例如-v21。)发现hdpi的变化,
mdpi,xhdpi, xxhdpi,xxxhdpi

我该如何解决这个问题?

How can I fix this?

推荐答案

AndroidManifest.xml中的资源变化被检测为错误。

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

它可能会被忽略:

<?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>

参见:
Android:Facebook应用程序ID显示值-ta / strings.xml中的错误,但不能能够生成签名的apk

这篇关于从清单引用的资源不能因配置而异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆