Android studio - Gradle building finished with non-zero exit value 2

757 Views Asked by At

I'm facing an issue with Gradle build. I needed to add a dependency to Robobinding in my app to give it a try, and after spending 4 painfull hour to get sync successfull (damned Gradle!), now Gradle building throws this error:

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_25\bin\java.exe'' finished with non-zero exit value 2

What the heck is going on? To add the reference i copied what done in this project on GitHub, but unfortunatley it doesn't work for me: https://github.com/RoboBinding/RoboBinding-album-sample/blob/master/app/build.gradle

I found many threads that refers to Multidex, but my app is not so big and does not include an huge number of references. However i tried to enable it, but i get a strange error that i can't understand. I don't think this way leads to the solution because my app it's little (apk is ~2Mb), but this is the error i get:

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: org/robobinding/AttributeResolutionException.class

I only want to add a simple reference to Robobinding and some others in my application, why in the world i always have to cry and spend a lot of hour in doing this?

I link you my .gradle files:

Sorry for the outbrust but i don't know Gradle in the details, i don't have enought time to learn it and it always makes me nervous. My fault.

Thanks in advance!

1

There are 1 best solutions below

0
On

Why do you have so many dependencies nodes in your Module link? you only need one and in your multiple dependencies nodes, you duplicated RoboBinding dependency twice, which is the reason for the error.