How to Add Stacktrace or debug Option when Building Android Studio Project

Neoh picture Neoh · Feb 10, 2014 · Viewed 173.5k times · Source

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.

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?

Answer

pyus13 picture pyus13 · Feb 10, 2014

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

File > Settings > Compiler (Gradle-based Android Project)

For MacOS user, it's here

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

like this (add --stacktrace or --debug)

enter image description here

(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))