Android(安卓)Lint gradle错误处理
16lz
2021-01-26
一、Lint简介 英文原文:http://tools.android.com/tips/lint
参照文章:http://blog.csdn.net/thl789/article/details/8037473
参照文章:http://blog.csdn.net/thl789/article/details/8037473
Android Lint是SDK Tools 16 (ADT 16)之后才引入的工具,通过它对Android工程源代码进行扫描和检查,可发现潜在的问题,以便程序员及早修正这个问题。Android Lint提供了命令行方式执行,还可与IDE(如Eclipse)集成,并提供了html形式的输出报告。由于Android Lint在最初设计时就考虑到了independent于IDE,所以它可以很方便的与项目中的其他自动系统(配置/ Build / 测试等)集成.
Android Lint主要用于检查以下这些错误:
- Missing translations (and unused translations)没有翻译的文本
- Layout performance problems (all the issues the old layoutopt tool used to find, and more)
- Unused resources未使用的冗余资源
- Inconsistent array sizes (when arrays are defined in multiple configurations)在多个配置中的数组大小不一致文件
- Accessibility and internationalization problems (hardcoded strings, missing contentDescription, etc)
- Icon problems (like missing densities, duplicate icons, wrong sizes, etc)
- Usability problems (like not specifying an input type on a text field)
- Manifest errors
当然Android Lint远远不至检查以上的错误,更多的内容请参考《Android Lint 检查规则列表》
二、问题描述
用gradle build命令时,经常由于lint错误终止,而这些错误又经常是第三方库中的,我们可以跳过这些错误,继续编译。在build.gradle中加入如下代码:
lintOptions{ abortOnError false }
更多相关文章
- Android中遇到的一切BUG(到目前为止,这是我笔记薄别瞎喷,错误欢
- You cannot combine custom titles with other title feature
- Ubuntu 11.10 64bit系统编译android 2.3的相关问题
- [qt for android]构建项目时,出现“过程试图写入的管道不存在”错
- 错误日志-Android家长端登陆不了
- Qt Android(安卓)部署项目时报错
- android studio 解决debug adb端口问题,亲身经历总结
- Androrat 编译运行错误集
- Android(安卓)常见错误处理