我在Github Actions(项目的当前CI解决方案)上遇到了以下Lint错误。
> 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错误。
一些本地环境数据:
- Gradle包装器6.5
- Android Gradle插件4.1.0-beta02
- Kotlin 1.3.72
- JDK 1.8.0_242
对于这个被认为是“安全”的构建,为什么会产生不同的输出呢?有什么想法吗?