Skip to content Skip to sidebar Skip to footer

Difference Between Running Lint Via Android Studio Menu And Gradlew Command-line

When I run the following on a command line: ./gradlew -lint I get different results than if I choose the following menu option within Android Studio. Analyze->Inspect Code...

Solution 1:

You are running two different tools. The command:

$ ./gradlew lint

runs the lint tool that comes with the Android SDK and the menu option

Analyze->Inspect Code...

in Android Studio is a feature inherited from JetBrains IntelliJ IDEA which runs:

<android studio path>/bin/inspect.sh

Solution 2:

In Android Studio you can customize what inspections are run via Preferences > Inspections; you may have some Lint inspections disabled, and not all run by default. Android Studio can also run a great number of non-Lint inspections.

Solution 3:

If your project includes build variants, and you instead want to run the lint task for only a specific build variant, you must capitalize the variant name and prefix it with lint.

gradlew lintDebug

To learn more about running Gradle tasks from the command line, [read Build Your App from the Command Line.][1]

https://developer.android.com/studio/build/building-cmdline

Post a Comment for "Difference Between Running Lint Via Android Studio Menu And Gradlew Command-line"