当前位置: 首页 > 知识库问答 >
问题:

Gradle生成:任务执行失败:app:lint

伊裕
2023-03-14

我使用的是Android Studio 2.0,当我试图运行程序时,发生了一些奇怪的事情。我运行了gradle的build命令,得到了以下错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lint'.
> Lint found errors in the project; aborting build.

Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
    lintOptions {
        abortOnError false
    }
}
...

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.197 secs
Lint found errors in the project; aborting build.

Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
    lintOptions {
        abortOnError false
    }
}
...
10:41:28: External task execution finished 'build'.

因此...那是什么鬼东西?我应该做的是将代码添加到gradle.build来解决这个问题,但问题是:为什么我会得到这个错误消息?

请救救我伙计们!

共有3个答案

洪开诚
2023-03-14

构建应用程序模块时,出现了一些lint问题。

您可以在< code > Project \ module \ build \ outputs 中生成的报告中找到所有问题。< br >在这里您可以找到html文件和带有lint报告的xml文件。

app\build.gradle 中使用此脚本

android {
    lintOptions {
        abortOnError false
    }
}

您可以禁用该块,但这不是最佳做法。
您应该分析 Lint 报告以解决每个点。

鲍理
2023-03-14
    < li >切换到项目视图 < li >然后,项目/应用程序/构建/报告/lint-结果 < li >现在,您将发现两种格式的lint结果文件:1) xml和2) html。

您可以按原样查看这些文件。但是,我发现在浏览器中查看lint结果很容易。只需右键单击html文件,然后在浏览器中选择视图即可。

它像下面的图片一样在我的Chrome浏览器中打开。

宣冥夜
2023-03-14

将它添加到您的< code>app/build.gradle文件中

android {
    //...
    lintOptions {
        abortOnError false
    }
}
 类似资料: