I´m having a weird problem in Android Studio: The manually started linter via
Analyze -> Inspect Code -> "Whole project"
Finds some issues, however if I do it
./gradlew lint
in the console, it says
Ran lint on variant release: 0 issues found
Ran lint on variant debug: 0 issues found
I have no lintOptins
in my gradle file, but use a lint.xml
, here it is:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="all">
<ignore path="build" />
</issue>
<issue id="all">
<ignore path="businesslogic/build" />
</issue>
</lint>
My question: How to make console show same errors as Inspection in android studio?
gradlew lint and Analyze -> Inspect Code are basically two different checks
AndroidStudio runs a much more sophisticated set of checks than the gradle lint
To see the list of checks performed by Android studio you can see here http://tools.android.com/tips/lint-checks This means your code will go through lot more inspections in AndroidStudio Inspect than gradlew lint
If you still need the results to be same , you would have to deactivate any additional checks, which are not included in the set of predefined lint checks
See Difference between running lint via Android Studio menu and gradlew command-line
Basically, these are different tools so they have different inspections to check.
You might be able to set up gradle lint command to call the IntelliJ inspect.sh shell script. See the answer in that question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With