Custom lint error and warning are not shown in IDE & abortOnError is not working

289 views
Skip to first unread message

Bharathy Srinivas

unread,
Jun 1, 2021, 12:11:19 PM6/1/21
to lint-dev
Hi Lint Team,

Issue 1 :
After building the project all the error and warring are not shown in the IDE, but running ./gradlew app:lintDebug still list the errors. 
After running ./gradlew app:lintDebug errors and warning are shown in IDE.

Issue 2 : 
when abortOnError true is set in app build.gradle still the build is successfully, ideally it should fail. 
  android {
      lintOptions {
          abortOnError true
      }
  }

Versions I'm using
lintVersion = '27.2.0'
AGP = '4.2.1'
Android studio 4.2.1


Tor Norbye

unread,
Jun 1, 2021, 4:56:17 PM6/1/21
to lint-dev
On Tuesday, June 1, 2021 at 9:11:19 AM UTC-7 bharathy...@gmail.com wrote:
Hi Lint Team,

Issue 1 :
After building the project all the error and warring are not shown in the IDE, but running ./gradlew app:lintDebug still list the errors. 
After running ./gradlew app:lintDebug errors and warning are shown in IDE.

Yes, there are known bugs in the AGP packaging support around this. The AGP team has taken over the lint integration work in AGP so hopefully this part will get better soon!
 
Issue 2 : 
when abortOnError true is set in app build.gradle still the build is successfully, ideally it should fail. 
  android {
      lintOptions {
          abortOnError true
      }
  }

That should already be the case -- provided you're talking about running a lint target. If you mean while running an assemble target, then no, that's deliberate: lint is pretty expensive and people would complain if build times got significantly slower.

We do however have one exception to this: if you run a *release* assemble target, like ./gradlew :app:assembleRelease, then we *will* run lint, on a subset of issues (those with "fatal" severity), and we will fill the build in that case.

-- Tor


colto...@protonmail.com

unread,
Jun 3, 2021, 9:39:10 AM6/3/21
to lint-dev
I could have sworn the issue of not showing in the IDE was fixed but it regressed again.

Please star this bug if it's affecting you. I included a repro project + a video of it working in the past showing that it's a regression. Hopefully the priority can increase because it's a regression. https://issuetracker.google.com/issues/189593701

Reply all
Reply to author
Forward
0 new messages