Problem RAM. I had similar message in my Messages Gradle Build
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.
ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe''
finished with non-zero exit value 1
Why: I didn't have free RAM on my laptop with the OS windows 8.1.
Solution: I closed a few programs that I don't need. After that, I had more free RAM and my project was built in android studio.