Custom Lint Check Not Showing Errors in Android Studio

1,616 views
Skip to first unread message

Mike Ferraco

unread,
Oct 30, 2018, 1:44:33 PM10/30/18
to lint-dev
I have a custom lint check that I created as part of my Android project in Android Studio 3.2.1.  I basically just followed the instructions outlined here (https://medium.com/@vanniktech/writing-your-first-lint-check-39ad0e90b9e6). 

The IDE is not showing the Lint error in my Android app code where i Include the custom lint rule using the `lintChecks` gradle syntax.  Is there something I need to do in Android Studio for the IDE to pick up those checks and display the errors? However, the lint check is picked up when I run the lintDebug gradle task. 

I also started a new project from scratch and followed the exact setup outlined here:

https://github.com/googlesamples/android-custom-lint-rules/tree/master/android-studio-3

And I am still unable to see errors displayed in Android Studio even though the lintDebug gradle task does find them.


As a separate question, can I limit the scope of my lint check by using the `applicableSuperClasses` SourceCodeScanner method along with a UastHandler? The scope of my check does not seem to be limited when I add `applicableSuperClasses`.

Adam Williams

unread,
Nov 1, 2018, 5:40:05 PM11/1/18
to lint-dev
Hi Mike! I've also been having this issue. It seems that custom lint inspections don't work in AS 3.2+. It also looks like it should be fixed in 3.3

Here's a thread about the incoming fix, and also a workaround that might work for you: https://groups.google.com/forum/#!topic/lint-dev/HbTSx-dZ2JA
Reply all
Reply to author
Forward
0 new messages