Error-Expected resource of type styleable [ResourceType]

来源:互联网 发布:万汇电商淘宝代运营 编辑:程序博客网 时间:2024/05/18 17:01

错误信息

Expected resource of type styleable [ResourceType]

错误原因

最近在项目中由于要使用沉浸式通知栏,所以使用了一个工具类SystemBarTintManager,而这个工具类在项目打包的过程中提示了一个错误:Expected resource of type styleable

这里写图片描述

解决方案

在stackoverflow中发现很多人反馈这个问题,解决方案是在使用 TypedArray 的方法声明处顶部加上 @SuppressWarnings(“ResourceType”) 忽略该警告,然后就可以正常签名编译。具体做法如下:

@SuppressWarnings("ResourceType")public SystemBarTintManager(Activity activity) {            ……}
2 0
原创粉丝点击