16

I have a project which uses the ActionBarSherlock library. When I run Lint on my project, I get a lot of errors and warnings in ActionBarSherlock, which I don't care about.

How can I run Lint only on my project, not the libraries it uses? (Note: I am using the 'Check MyProject' option).

Bananeweizen
  • 21,797
  • 8
  • 68
  • 88
nhaarman
  • 98,571
  • 55
  • 246
  • 278

1 Answers1

16

I assume that you have ActionBarSherlock as a separate Android project in your workspace. If so, you can open the context menu on that project, use Properties -> Android -> Android Lint -> Ignore all.

Many preferences in Eclipse can be set for the whole workspace (using Window -> Preferences) and for single projects (as above), where the project preferences then override the workspace preferences for that specific project.

Bananeweizen
  • 21,797
  • 8
  • 68
  • 88
  • 3
    This works when I run lint on the ABS project, but when I run lint on my project, the errors of the ABS project still show up. – nhaarman Jul 21 '12 at 17:31
  • 1
    Indeed, I just reproduced that. Please vote for the corresponding [bug entry](http://code.google.com/p/android/issues/detail?id=33847) in the Android issue tracker. – Bananeweizen Jul 22 '12 at 04:41
  • 1
    Message from Google: `Fixed in ADT 21. Thanks for the report!`. Great! Thanks for you effort! – nhaarman Jul 25 '12 at 11:26
  • @Niek, ADT 21.0.1 - the same bug... As [developers said](http://code.google.com/p/android/issues/detail?id=33847#c12) it wasn't fixed in ADT 21. – Paul Annekov Jan 09 '13 at 09:36
  • True. That message came after mine ;) – nhaarman Jan 09 '13 at 15:48
  • Don't right click on your project and ask to check lint warnings. You should select your project and click the refresh icon in the lint warnings view. This works and displays errors only for your project. – Snicolas Feb 04 '13 at 14:33
  • 2
    @Niek: There is now a new option in the latest ADT 21.1 which fixes that bug. Have a look at my answer to this question: [Android Lint report for my project only, excluding library projects?](http://stackoverflow.com/a/15047641/1427177) – jenzz Feb 24 '13 at 01:21
  • What about other warnings and errors? Is it possible to make ActionBarSherlock library ignore all of them too? – android developer Apr 14 '13 at 14:33
  • Great answer. Till now dont know about ignoring project specific lint errors. – Smeet Jul 11 '15 at 11:37