If you just want to configure your Android Studio project to run the lint check before the default run configuration without affecting how your gradle tasks are configured, you can follow these steps.
- Open the run configurations drop down and choose edit
- Select your app run configuration
- Press the '+' to add a new step
- Choose "Gradle-aware Make"
- Type 'check' and choose the option with your app module name and check. (Mine is
:app:check
)
- Press the up arrow to move the new
check
step before the existingGradle-aware make
step
Now, Android Studio will run the lint check and fail the build if any lint errors occur.