命令行缺少问题组上的Android皮棉(与Android Studio中可用的选项相对) [英] Android lint on command-line missing issue groups (versus options available in Android Studio)

查看:95
本文介绍了命令行缺少问题组上的Android皮棉(与Android Studio中可用的选项相对)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过Analyze-> Inspect Code在Android Studio中运行lint时,我可以从各种各样的东西中进行选择.

When I run lint in Android Studio via Analyze -> Inspect Code I am able to select from a large variety of things to look for.

当我进入lint的命令行版本并列出所有要检查的内容(lint --list)时,我得到的列表不包括我在Android Studio中看到的所有检查.

When I go to the command-line version of lint and list all available things to check (lint --list), I get a list that does not include all the inspections I see in Android Studio.

例如,我可以在Android Studio中使用ID ConstantConditions进行检查,但是无法在命令行上运行它.

For example, I am able to run an inspection with ID ConstantConditions in Android Studio, but am unable to run it on the command-line.

~/app [master] lint --check ConstantConditions --xml results.xml app
  Invalid id or category "ConstantConditions".

Android Studio是否使用其他版本的lint?这是有关lint命令行版本的一些信息:

Is Android Studio using some other version of lint? Here is some info on the command-line version of lint:

~/app [master] which lint
  lint is /Users/Mark/android-sdk-macosx/tools/lint
~/app [master] lint --version
  lint: version 24.3.3

推荐答案

IntelliJ IDEA具有检查"的概念,并且Android Studio继承了此概念.对于Android Studio检查引擎报告的任何给定问题,可以有三个理论来源:

IntelliJ IDEA has a concept of "inspections", and Android Studio inherits this. For any given problem reported by Android Studio's inspection engine, there can be three theoretical sources:

  1. 一种IDEA常规检查,Android Studio只是采用了这种检查.

  1. A stock IDEA inspection, one that Android Studio simply adopted.

特定于Android Studio的检查,可能只是从IDE内部而不是从外部Lint工具可以容易地检测到的东西.

An Android Studio-specific inspection, for something that perhaps can only readily be detected from within the IDE versus from external Lint tools.

Lint的东西.

我不知道#2是否真的被任何东西使用,但这完全在可能性范围之内.

I have no idea if #2 is actually used by anything, but it's well within the realm of possibility.

就您的错误而言,要么不是Lint(例如,IDEA检查),要么是表示检查的方式与等效命令行之间的命名差异.由于这些资料没有特别有据可查,所以很难说是怎么回事.

In terms of your error, either that's something that is not Lint (e.g., an IDEA inspection) or there is a naming difference between how the inspection is represented and the command-line equivalent. Since this stuff isn't especially well-documented, it's difficult to say what's going on.

但是,总的来说,不要以为您看到的Android Studio大喊大叫的一切都一定是Lint提供的.

However, in general, do not assume that everything that you see Android Studio yelping about is necessarily something from Lint.

这篇关于命令行缺少问题组上的Android皮棉(与Android Studio中可用的选项相对)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆