AndroidStudio中重复的jar怎么处理?

How to deal with the repeated jar in Android Studio?

如图,"xxx finished with non-zero exit value 2",有人说是repeat jars造成的it.But我没有找到repeat jars yet.So,请问如何处理?

http://i3.tietuku.com/10ec1b3775cbb850.png

应用程序 - build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.myatejx.quicknote"
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 4
        versionName "1.2.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}

dependencies {
    compile project(':SwipeMenuListView')
    compile project(':Ldrawer')
    compile project(':Snackbar')
}

SwipeMenuListView - 库 - build.gradle:

    apply plugin: 'com.android.library'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
            }
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile files('libs/android-support-v4.jar')
}

Snackbar - 图书馆 - build.gradle:

    apply plugin: 'com.android.library'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}

dependencies {
    compile 'com.android.support:recyclerview-v7:22.0.0'
    compile 'com.android.support:support-annotations:22.0.0'
}

apply from: 'maven-push.gradle'

Ldrawer - 库 - build.gradle:

    apply plugin: 'com.android.library'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}

dependencies {
    compile 'com.android.support:support-v4:22.0.0'
}

//apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

试试这个, 在你的代码中

 defaultConfig {
        applicationId "com.myatejx.quicknote"
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 4
        versionName "1.2.0"
        multiDexEnabled true
    }

如果 multidex 是 enabled.The gradle 将忽略重复的 dex 文件