How can I make “gradle –stacktrace” the default?

Not in gradle.properties but in build.gradle itself. Add the following piece of code at the very beginning of the build script:

import org.gradle.logging.ShowStacktrace
gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS
throw new RuntimeException('lol')

Or in Android Studio:

import org.gradle.api.logging.configuration.ShowStacktrace
gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS

It also might be put in init script.

As pointed out in the comments, from gradle v. 2.14 it will be:

gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.ShowStacktrace.ALWAYS

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)