一,Error* : expected resource of type drawable
原因:
animation-list的文件放在anim文件夹下了
解决的两种方式:
1,移动文件到drawable文件夹下
2,替换
_loadigIcon.setImageResource(R.anim.loading_animation);
为
_loadigIcon.setImageResource(+R.anim.loading_animation);
二、obtainStyledAttributes annotated with @StyleableRes. Suppress warnings(expected resource of type)
原因:TypedArray ta = obtainStyledAttributes(R.style.MyCustomStyle, attrs)
解决:(在它的函数上添加)
@SuppressWarnings("ResourceType")
三、Android xxx is not translated in zh
原因:在默认的strings.xml中有值,但是在values-zh文件夹下的srings.xml中没有值导致
Lint的终极解决办法:
在主项目的builde.gralde里添加如下代码
原因:TypedArray ta = obtainStyledAttributes(R.style.MyCustomStyle, attrs)
解决:(在它的函数上添加)
@SuppressWarnings("ResourceType")
三、Android xxx is not translated in zh
原因:在默认的strings.xml中有值,但是在values-zh文件夹下的srings.xml中没有值导致
Lint的终极解决办法:
在主项目的builde.gralde里添加如下代码
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to checkforerrorsinrelease builds,
// but continue the build even whenerrorsarefound:
abortOnError false
}
}