升级Android支持库23.2.0后的代码分析错误(意外的名称空间前缀) [英] Code Analysis Error (Unexpected namespace prefix) after upgrading Android Support Library 23.2.0
问题描述
我已升级到Android支持库23.2.0并添加了
I upgraded to Android Support Library 23.2.0 and added
vectorDrawables.useSupportLibrary = true
到我的build.gradle,以便我对低于21的api具有矢量可绘制的支持(请参阅
to my build.gradle, so that I have vector drawable support for apis lower than 21. (See here for details).
我也替换了
android:src="@drawable/ic_create_black_24dp"
与
app:srcCompat="@drawable/ic_create_black_24dp"
在每个使用矢量可绘制对象的Imageview中.
in every Imageview that uses vector drawables.
该应用程序可以编译并正常运行,但是代码分析报告:
The app compiles and works perfectly fine, but code analysis reports:
错误:(56,9)为标签
ImageView
为什么会这样?为什么在我遇到错误的情况下为什么要编译?
Why is this the case? Why is it compiling although I am getting errors?
我已添加
xmlns:app="http://schemas.android.com/apk/res-auto"
在我的根目录布局中.
推荐答案
Lint,Android的代码分析工具,似乎还不知道支持矢量可绘制对象.您可以通过在ImageView
标记中添加tools:ignore="MissingPrefix"
来安全地忽略该错误.
Lint, Android's code analysis tool, doesn't seem to know about support vector drawables, yet. You can safely ignore the error by adding tools:ignore="MissingPrefix"
to the ImageView
tag.
这篇关于升级Android支持库23.2.0后的代码分析错误(意外的名称空间前缀)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!