一、删除没有用到的资源(图片,string 等等)
先看怎么样找到没有用到的资源,注意:注释掉的 也属于没有用到的。
1、进行代码分析操作
打开项目-》Analysis-》Inspector code
2、查看结果

3、Unused resource (未使用的资源)

4、删除对应的资源即可
二、删除掉类中没有引用到的包
1、灰色字体代表没有使用的包,需要删除

2、代码审查同上,Unused import(未使用的引用包)

找到上面的代码,删掉就可以了。
三、通过Inpection name 执行lint。删除无用资源
1、analysis-》run inspection by name
2、输入名字

3、选择整个项目或者模块
四、通过dos 命令执行lint
1,进入Dos,如果没有配置环境变量,那就cd到lint批处理文件所在目录
2,lint --check"UnusedResources"project路径 > 存放路径/result.txt

网友评论