"LintError" 发现正在处理 android lint 报告

"LintError" found processing android lint report

我已经生成了 Lint 文件结果(通常命名为 lint-results.xml)并在 Android 中正确配置了 android 项目Studio 到 运行 声纳(使用 sonar-runner)。

当我执行 sonar-runner 时,我得到了下一个错误:

INFO 13:49:02.776 > 13:49:02.776 INFO  - Sensor org.sonar.plugins.android.lint.AndroidLintSensor@5d5f10b2
INFO 13:49:02.832 > 13:49:02.832 INFO  - Processing android lint report: C:\Code\Android\Project\app\lint-results.xml
INFO 13:49:03.477 > 13:49:03.475 WARN  - Unable to find rule for LintError
[...]
INFO 13:49:03.505 > 13:49:03.505 WARN  - Unable to find file C:\Code\Android\Project\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-ads.3.0\AndroidManifest.xml to report issue
[...]
INFO 13:49:04.678 > 13:49:04.678 INFO  - Sensor org.sonar.plugins.android.lint.AndroidLintSensor@5d5f10b2 (done) | time=1902ms

是什么导致了这些错误?

我应该更深入地研究 lint-results.xml 文件。该错误在那里得到了充分解释。就我而言:

<?xml version="1.0" encoding="UTF-8"?>
<issues format="4" by="lint 24.1.2">

   <issue
       id="LintError"
       severity="Error"
       message="No `.class` files were found in project &quot;debug&quot;, so none of the classfile based checks could be run. Does the project need to be built first?"
       category="Lint"
       priority="10"
       summary="Lint Failure" explanation="This issue type represents a problem running lint itself. Examples include failure to find bytecode for source files (which means certain detectors could not be run), parsing errors in lint configuration files, etc.
These errors are not errors in your own code, but they are shown to make it clear that some checks were not completed.">
       <location  file="C:\Code\Android\TestApp\app\build\intermediates\manifests\androidTest\debug"/>
    </issue>

消息告诉我由于依赖关系问题,项目尚未完全构建。

解决该错误后,一切正常。