简体   繁体   English

Android Studio-Gradle构建完成,退出值非零2

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

I'm facing an issue with Gradle build. 我遇到了Gradle构建问题。 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: 我需要在我的应用程序中向Robobinding添加一个依赖项以进行尝试,并且在花了4个令人痛苦的小时来成功同步(该死的Gradle!)之后,现在Gradle构建会引发以下错误:

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 为了添加参考,我在GitHub上复制了此项目中完成的操作,但不幸的是,它对我不起作用: 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. 我找到了许多引用Multidex的线程,但是我的应用程序不是很大,并且不包含大量引用。 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: 我不认为这种方式会导致解决方案,因为我的应用程序很小(apk为〜2Mb),但这是我得到的错误:

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? 我只想在我的应用程序中添加一个对Robobinding和其他一些东西的简单引用,为什么在世界上我总是不得不哭泣并花很多时间来做到这一点?

I link you my .gradle files: 我将您的.gradle文件链接到您:

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. 对不起,很抱歉,但是我不知道Gradle的细节,我没有足够的时间来学习它,这总是让我感到紧张。 My fault. 我的错。

Thanks in advance! 提前致谢!

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. 您只需要一个,并且在多个依赖项节点中,您两次复制了RoboBinding依赖项,这就是导致错误的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM