本文介绍了构建 Android Studio 项目时如何添加 Stacktrace 或调试选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图调查控制台输出中的项目构建错误,如下所示:

I was trying to investigate the project build error in the console output as follow:

:myapp:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
...
...

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

我怀疑这与资源未找到错误有关.我的问题是,在 IDE 级别,如何添加 --stacktrace--debug 选项,以便它可以生成更多信息供我调试?

I suspect it has something to do with resource not found error. My question is, at IDE level how can I add --stacktrace or --debug option so that it can produce more information for me to debug?

推荐答案

您可以使用 GUI 从

You can use GUI to add these gradle command line flags from

File > Settings > Build, Execution, Deployment > Compiler

对于 MacOS 用户,它在这里

For MacOS user, it's here

Android Studio > Preferences > Build, Execution, Deployment > Compiler

像这样(添加--stacktrace--debug)

注意截图是0.8.10之前的,Compiler>中的选项不再Gradle 部分,它现在位于名为 Compiler (Gradle-based Android Project)

Note that the screenshot is from before 0.8.10, the option is no longer in the Compiler > Gradle section, it's now in a separate section named Compiler (Gradle-based Android Project)

这篇关于构建 Android Studio 项目时如何添加 Stacktrace 或调试选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 19:57