gpt4 book ai didi

android - 使用 gradle build android app 时 Lint 失败

转载 作者:太空宇宙 更新时间:2023-11-03 12:18:46 25 4
gpt4 key购买 nike

我用 android studio 创建了一个应用程序,但每次我尝试使用命令 gradle build 构建应用程序时,它都会显示“lint 失败”。当我检查 gradle 构建的调试信息时,它说:

21:10:26.215 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon,5,main]] finished, busy: 1.263 secs, idle: 0.034 secs
21:10:26.219 [ERROR] [org.gradle.BuildExceptionReporter]
21:10:26.221 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
21:10:26.222 [ERROR] [org.gradle.BuildExceptionReporter]
21:10:26.222 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
21:10:26.223 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':MyApp:lint'.
21:10:26.224 [ERROR] [org.gradle.BuildExceptionReporter] > class org.objectweb.asm.tree.ClassNode has interface org.objectweb.asm.ClassVisitor as super class
21:10:26.225 [ERROR] [org.gradle.BuildExceptionReporter]
21:10:26.226 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
21:10:26.228 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':MyApp:lint'.
21:10:26.229 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
21:10:26.229 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
21:10:26.230 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
21:10:26.231 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
21:10:26.231 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
21:10:26.232 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
21:10:26.233 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
21:10:26.233 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
21:10:26.234 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
21:10:26.235 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
21:10:26.235 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
21:10:26.236 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
21:10:26.237 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
21:10:26.237 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
21:10:26.237 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
21:10:26.238 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
21:10:26.238 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
21:10:26.239 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
21:10:26.239 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)

我已经搜索了很多,但找不到解决方案。任何人都可以帮忙吗?提前致谢。

最佳答案

我通过在 build.gradle 中添加 lintOptions 解决了同样的问题:

android {

lintOptions {
abortOnError false
}
}

IntelliJ 提示:修复由 lint 识别的问题,或将以下内容添加到您的构建脚本以处理错误:

关于android - 使用 gradle build android app 时 Lint 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23518991/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com