I used gradle build command in Centos 7 terminal and I got output:
FAILURE: Build failed with an exception. * What we
For me, killing the Gradle daemon (gradle --stop) really helped and fixed the issue.
gradle --stop