2

When I run lint "in" Android Studio (Analyze -> Inspect Code) I see a report of many issues in my application. However, when I run gradlew lint I am told no issues exist!

My lintOptions section in my app.gradle file is:

lintOptions {
    warningsAsErrors true
    abortOnError true
    xmlReport false
    htmlOutput project.file('build/reports/lint/lint-report.html')
}

Am I doing something wrong? Why would there be zero issues found when using the gradlew lint command?

Zach
  • 3,909
  • 6
  • 25
  • 50

1 Answers1

5

I summed up some of my research about lint here.

Basically gradlew lint is using lint.xml with a ruleset R. Android Studio Analyze using is using R from lint.xml as well as ruleset P from the inspection profile.

Therefore it is possible for a rule in P to trigger in Analyze but not in gradlew lint!

LastFreeNickname
  • 1,445
  • 10
  • 17
  • It's been a while and I apologize, but thank you for the investigation work you did. You are totally correct - Android Studio Analyze does a lot more than just Lint checking and the rulesets/tools running in both cases are not the same. – Zach Sep 27 '17 at 13:18