我得到了以下关于Github操作的Lint错误(该项目的当前CI解决方案)
> Task :application:lint FAILED
Ran lint on variant debug: 1 issues found
Ran lint on variant release: 1 issues found
Wrote HTML report to file:///~/application/build/reports/lint/lint-results.html
64 actionable tasks: 55 executed, 9 from cache
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':application:lint'.
> Lint found errors in the project; aborting build.
android {
lintOptions {
abortOnError false
}
}
...
Errors found:
~/application/build.gradle.kts:17: Error: Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details. [OldTargetApi]
targetSdkVersion(29)
~~我的targetSdkVersion已经设置为29了。

如果我在本地运行完全相同的命令( ./gradlew build),则不会报告lint错误。

一些当地环境数据:
4.1.0-beta02
对于为什么这个所谓的“包含”的构建会导致不同的输出,有什么想法吗?
发布于 2021-07-21 16:01:36
不合适的解决方案,只是一个临时的解决办法,如果你不想禁用皮棉检查。
在您的lint.xml文件夹中创建一个app文件,并列出要被lint忽略的build.gradle文件:
<lint>
<issue id="OldTargetApi">
<ignore path="build.gradle"/>
</issue>
</lint>https://stackoverflow.com/questions/62594074
复制相似问题