1

when i was trying to execute my android studio wear application it shows lint error.

Here is my log :

Error:Execution failed for task ':wear: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
    }
}

...

2 Answers2

5

Add this to your build.gradle file

android {
    lintOptions {
        abortOnError false
    }
}
Nadir Belhaj
  • 11,953
  • 2
  • 22
  • 21
  • Your answer doesn't explain anything and just repeat what's in the logs. IMO you get rid of the symptoms but not of the root of the problem. A bit more of context/explanation would be welcome. – n3wbie Jan 26 '18 at 10:35
  • 1
    Thanks @n3wbie, lint is a tool that checks for structural code problems that affects quality and performance of your application and by adding this peace of code you let grade to build your app even if lint errors are detected. And it is strongly recommended to correct lint errors before production. – Nadir Belhaj Jan 29 '18 at 15:13
  • Thank you for providing this additional explanation ! So if you don't correct these errors, the build will be done but the app will 'just' suffer a lack of optimization ? – n3wbie Jan 29 '18 at 16:58
  • 1
    @n3wbie yes indeed – Nadir Belhaj Jan 30 '18 at 09:22
0

Add this to your module level build.gradle file

> lintOptions {
>         abortOnError false
>     }

This will stop aborting of gradle if any lint error found, even though this is not recommended.

Alternatively you can just go to yourproject>app>build>results>lint_error.htmland then see errors and solve them or, you can also go for,

Analyze>Inspect Code and solve errors beforehand.

Hope this will solve your query.

Atul Yadav
  • 174
  • 1
  • 3