After more than 6 hours of trying to solve, one Oleg tied me up in the comments, finally leading me to the real cause of the problem.
A brief explanation of the problem can be found HERE , but I will try to explain how everything looked in my system:
This error first appeared for me when I imported a jar file that was part of my main Java project that was hosted in Eclipse.
The way this error first lends itself to the user is the Messages tab, where Gradle performs each of his tasks. The task with which he falls is
:app:transformClassesWithDexForDebug
The problem is that the Gradle Messages message box simply says a failed task and then gives a message without a descriptive message saying
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_45\bin\java.exe'' finished with non-zero exit value 1
To get a better overview, you need to take a look at the Gradle Console view. The terminal text tells you the following:
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_45\bin\java.exe'' finished with non-zero exit value 1 * Try: Run with
Scrolling a bit shows that stacktrace went very well, although this initial message suggests that additional flags should be added for debugging. The top of stacktrace says the following:
UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
But even that doesn't help much. What he is trying to tell you (very badly what I have to add) is that the class he is looking at was compiled with a version of Java that is not supported. In my case, version (0034) was a hexadecimal representation of 52, which means Java 8. Android does not support Java 8, so it completes the build.
The solution was to go back to my Eclipse project and export the jar file with the compiler installed in version 1.7, and now everything is up and running again. Hope this helps!