在我的 Manifest.xml 中,出现以下错误:
Resources referenced from the manifest cannot vary by configuration (except for version qualifiers, e.g. -v21.) Found variation in hdpi, hdpi-v11, mdpi, mdpi-v11, xhdpi, xhdpi-v11, xxhdpi, xxhdpi-v11, xxxhdpi, xxxhdpi-v11
它似乎在提示两个资源:
<meta-data
android:name="com.parse.push.notification_icon"
android:resource="@drawable/ic_stat_ic_no_notifications" />
和
<meta-data
android:name="com.yitter.android.notification_icon"
android:resource="@drawable/ic_launcher" />
我应该将这两个图像放在我的 no-dpi 文件夹中吗?它似乎在提示每个资源组都存在差异这一事实。我该怎么办?
我觉得 tools:ignore="ManifestResource"
(参见此处: Resources referenced from the manifest cannot vary by configuration )实际上并不能解决问题(如果有的话),只是创可贴而已。
更新:
实际上会导致构建错误......
Error:Execution failed for task ':app:processDebugManifest'.
> D:\android\app\src\main\AndroidManifest.xml:77:9-84:20: Error: Invalid instruction 'targetApi', valid instructions are : REMOVE,REPLACE,STRICT
最佳答案
您可以在元数据标记中使用tools:ignore="ManifestResource"。 如果其他文件(例如 arrays.xml)发生错误,则使用 translatable="false"
关于java - list 中引用的资源不能因配置而异?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39840607/