5

I am getting lint error in android studio as

Error:Execution failed for task ':app:lint'. Lint found errors in the project; aborting build. Fix the issues identified by lint, or add the following to your build script to proceed with errors:

android { lintOptions { abortOnError false } }

Information:BUILD FAILED Information:Total time: 7.288 secs Information:1 >error Information:0 warnings

Build is getting failed But it is not showing where exactly the error and even IDE(Android studio) is also not displaying any error mark in files. How to redirect lint error to source file.?

I don't want to skip the lint check.

Please help me.

Madhukar Hebbar
  • 3,113
  • 5
  • 41
  • 69

2 Answers2

12

From the command line, run gradlew lintDebug (or gradlew lint[variantName] for a different variant).

This will generate a full lint report at /app/build/outputs. I recommend the HTML version (lint-results-debug.html). In there you will find all Android lint issues and their severity.

Alternatively, you can go to Analyze > Inspect Code in Android Studio to run lint. Switch the view to group them by severity- the errors are the ones blocking your build.

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
  • How can one remove warnings and typos? Details of these variables are also shared when we group by severity. – Abhiroj Panwar May 14 '17 at 21:18
  • Note that you may need to add the --debug or --info flag to generate the html report – crobicha Oct 09 '17 at 19:32
  • If you only want to see vital lint error that causes 'release' to stop, then from the command line type: gradlew lintVital[variantName] – jclova Jun 26 '18 at 15:47
3

The erros reports with the lines and exactly erros font are found in: Your app release builds folder, then:appname/app/build/reports.

there you will find the lint-results-release-fatal. Open it in any browser to find the problems.

Hope it helps.

Thiago Silva
  • 670
  • 6
  • 18