java - 错误 : Execution failed for task ':app:packageAllDebugClassesForMultiDex'

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

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

非常感谢。

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

java.util.zip.ZipException: duplicate entry:android/support/annotation/AnimRes.class

安卓{ 编译SDK版本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;
    }
}

最佳答案

终于找到原因了。

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

这是重复导入的库!

关于java - 错误 : Execution failed for task ':app:packageAllDebugClassesForMultiDex' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35095272/

相关文章:

java - 扫描仪处于 while 循环中,循环不会退出

android - 如何将 Admin SDK api 添加到 android 项目

android - 不明白 Android 中的 java.lang.ClassCastException 错误

java - handleWindowVisibility : no activity for token android. os.BinderProxy

android-studio - 项目 build.gradle 文件无法打开,Android Studio

java - 如何使用 google maps api for android 将 map 限制在一个国家

java - 在 Java 1.4.2 中使用 Saxon-B(版本 9.1.0.8)需要帮助

java - 按顺序执行两个 Action

java - 将 ejb 注入(inject) jsf 托管 bean 时出错

android - 创建一个游标指向一个数组