Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

gradle - android project: process finished with non-zero exit value 2

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 FilesJavajdk1.7.0_79injava.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'



}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...