Status Update
Comments
tn...@google.com <tn...@google.com> #2
Lint options:
lintOptions {
lintConfig = file('lint.xml')
abortOnError true
xmlReport true
htmlReport true
checkDependencies true
}
Also, our project has custom lint rules. Failure happens with a dependency of 26.6.3 and 27.0.0.
Is any way to downgrade lint runner? This problem is keeping us from using AGP 4.0
sp...@google.com <sp...@google.com> #3
Attached slightly different stacktrace for the same problem.
Wonder if disabling some lint rules could help to "fix" this problem, as it is also blocking for us 4.0 AGP upgrade.
sp...@google.com <sp...@google.com> #4
Notes:
I suspect the exceptions are happening now because JetBrains recently changed an assert
statement into a hard failure (see
I.e., it's possible that Lint has been hitting this code path all along, and only now it is causing a problem.
This has been difficult to investigate so far because the failure is nondeterministic and also deep inside the Kotlin compiler. Plus, JetBrains seems to be hitting this code path occasionally too (hence why they changed the assert into a hard failure), so I'm not even sure whether Lint is implicated or not.
Description
Currently, with
android.lintOptions.textReport true
, lint will output results to stdout when theAndroidLintTask
(e.g.,lintDebug
) runs, but there will be no such output if the task is up-to-date, which might mislead users to think that there are no lint issues.The desired behavior is for lint to output issues to stdout even if the task is up-to-date (or not to output anything if there are no issues - see Issue 158259845 ).
A possible fix would be to add a new lightweight task which would never be up-to-date and would only print the text report. I.e., change the lint build flow from this:
lintAnalyzeDebug
->lintDebug
to this:
lintAnalyzeDebug
->lintReportDebug
->lintDebug
where the new
lintReportDebug
task is the oldlintDebug
task, and the newlintDebug
is the lightweight task that is never up-to-date.Rejected alternative:
I considered modifying Issue 189877657
AndroidLintCopyReportTask
to print out the text report, but that task will not run ifAndroidLintTask
is up-to-date. In fact, we can consider adding that task's functionality to the new lightweight lint task to properly fixPS - Thanks to Tor for noticing this issue :)