转自:http://blog.youkuaiyun.com/mynameishuangshuai/article/details/51799410
错误信息
Expected resource of type styleable [ResourceType]
错误原因
最近在项目中由于要使用沉浸式通知栏,所以使用了一个工具类SystemBarTintManager,而这个工具类在项目打包的过程中提示了一个错误:Expected resource of type styleable
解决方案
在stackoverflow中发现很多人反馈这个问题,解决方案是在使用 TypedArray 的方法声明处顶部加上 @SuppressWarnings(“ResourceType”) 忽略该警告,然后就可以正常签名编译。具体做法如下:
@SuppressWarnings("ResourceType")
public SystemBarTintManager(Activity activity) {
……
}
本文介绍了一个在使用SystemBarTintManager工具类时遇到的Expectedresourceoftypestyleable错误及其解决方案。通过在代码中添加@SuppressWarnings(ResourceType)注解,可以成功忽略此错误并完成应用的编译。
7664

被折叠的 条评论
为什么被折叠?



