错误:任务':app:packageAllDebugClassesForMultiDex'执行失败

时间:2016-01-29 22:34:01

标签: java android android-studio android-gradle build.gradle

最近我更新了我的Android Studio,这个错误就出来了。有什么建议吗?

非常感谢。

错误:任务':app:packageAllDebugClassesForMultiDex'执行失败。

  

java.util.zip.ZipException:重复条目:android / support / annotation / AnimRes.class

android {     compileSdkVersion 23     buildToolsVersion" 23.0.2"

defaultConfig {
    applicationId "com.tankexchange.android.app.tankwallet"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 21
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':library_volley')
    compile project(':library_api')
    compile "com.android.support:support-v4:23.1.1"
    compile "com.android.support:support-v13:23.1.1"
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:gridlayout-v7:23.1.1'
    compile 'com.google.android.gms:play-services-location:8.3.0'
    compile 'com.google.android.gms:play-services-maps:8.3.0'
    compile 'com.google.android.gms:play-services-plus:8.3.0'
    compile 'com.google.android.gms:play-services-gcm:8.3.0'
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
    compile 'com.google.maps.android:android-maps-utils:0.3+'

    compile 'com.makeramen:roundedimageview:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') {
        transitive = true
    }
    compile 'com.flipboard:bottomsheet-core:1.4.3'
    compile 'com.facebook.rebound:rebound:0.3.7'
    compile 'me.grantland:autofittextview:0.2.1'
    compile 'com.balysv:material-ripple:1.0.2'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.0'
    compile 'com.karumi:dexter:2.1.3'

    compile 'com.braintreepayments.api:braintree:2.+'
    compile 'com.braintreepayments:card-form:2.1.1'
    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
}

}

2 个答案:

答案 0 :(得分:1)

最后,我找到了原因。

compile ('com.karumi:dexter:2.1.3'){
            exclude module: 'support-annotations'
        }

这是lib有重复导入!

答案 1 :(得分:0)

在App Gradle文件中启用multiDexEnabled

android {

    defaultConfig {
            ...
        multiDexEnabled true
    }


dependencies {
            ...
    compile 'com.android.support:multidex:1.0.1'

}