原标题:Error-Expected resource of type styleable [ResourceType]
错误信息
Expected resource of type styleable [ResourceType]
错误原因最近在项目中由于要使用沉浸式通知栏,所以使用了一个工具类SystemBarTintManager,而这个工具类在项目打包的过程中提示了一个错误:Expected resource of type styleable
在stackoverflow中发现很多人反馈这个问题,解决方案是在使用 TypedArray 的方法声明处顶部加上 @SuppressWarnings(“ResourceType”) 忽略该警告,然后就可以正常签名编译。具体做法如下:
@SuppressWarnings("ResourceType")
public SystemBarTintManager(Activity activity) {
……
}