I'm unable to compile my android project. Google and other SO posts tell me it (probably) has something to do with dependencies, but I can't find where. Here's the error:
Error:Gradle: Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2
and my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.skate.socialskate"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.google.apis:google-api-services-youtube:v3-rev136-1.20.0'
compile 'com.android.support:cardview-v7:22.1.0'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.2.+'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.+'
compile 'org.jsoup:jsoup:1.8.2'
compile 'com.github.shell-software:fab:1.1.0'
compile 'com.google.api-client:google-api-client:1.18.0-rc'
}
This happened for me when I was refactoring some class files to a library project and I had a duplicate name of a class file. So, double check that you do not have any duplicate names.
In my case I write in the
build.gradle
dependencies from the parse quick guidethen I replace with
Save the changes, restart the android studio and run the project. It worked in my case.
I have used this command in build.gradle file.
It has resolved this "non-zero-exit-value" and another one 'duplicate entry during packageAllDebugClassesForMultiDex'.
Android Studio suggests,
After Removing Plus Sign and Adding a Specific Version problem was solved in my case.
The date of when this happened to me was 07/08/2016.
I just got this exact error after updating to the newest android studio.
I resolved it by updating my java jdk from java jdk 7 to java jdk 8.
Now my builds work fine. I think the newest version of android studio requires jdk 8…