Android Studio - 任务 packageAllDebugClassesForMultiDex 重复条目执行失败

标签 android android-studio gradle dependencies build.gradle

我在 Android Studio 中使用我的 Android 应用程序时遇到一个奇怪的问题。在添加新文件并对 build.gradle 进行一些更新后,一切似乎都运行良好。

我看到的错误消息如下:

Error:Execution failed for task ':myApplication:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: bolts/AggregateException.class

你知道我下面的build.gradle有没有问题?新行位于“NEW DEPENDENCIES ADDED BELOW THIS LINE”下。我还将 multiDexEnabled 设置为 true。

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'
    useLibrary  'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.my.app"
        minSdkVersion 14
        targetSdkVersion 21
        multiDexEnabled true
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    //useLibrary  'org.apache.http.legacy'
}

dependencies {
    compile files('libs/aspectjrt-1.8.2.jar')
    compile files('libs/bolts-android-1.2.1.jar')
    compile files('libs/isoparser-1.0-RC-27.jar')
    compile files('libs/multiscreen-android-1.1.11.jar')
    compile files('libs/picasso-2.5.2.jar')
    compile files('libs/volley.jar')
    compile 'com.facebook.android:facebook-android-sdk:4.5.0'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:support-v13:+'

    /* NEW DEPENDENCIES BELOW THIS LINE */
    compile 'com.android.support:design:23.0.1' 
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.github.bumptech.glide:glide:3.6.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'

    // Used to optimize rendering of list views
    // compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'uk.co.chrisjenx:calligraphy:2.1.0'
    //compile 'com.squareup.picasso:picasso:2.5.2'

    compile 'com.google.android.gms:play-services:7.8.0' 
    //compile 'com.mcxiaoke.volley:library-aar:1.0.0' 
    compile 'com.google.android.gms:play-services-plus:7.8.0'
    compile 'com.google.android.gms:play-services-wallet:7.8.0'
}

最佳答案

compile files('libs/bolts-android-1.2.1.jar')

你添加了哪个包?

它说你在 2 库中有 bolts/AggregateException.class。

尝试找出哪个jar包含AggregateException

关于Android Studio - 任务 packageAllDebugClassesForMultiDex 重复条目执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33771150/

相关文章:

java - 在拨号器应用程序顶部检测来电并在后台打开服务

android - 用于将方法参数分配给 Android Studio 中的字段的 Kotlin 快捷方式

java - 带工具栏的 RecyclerView

security - 如何在不对它们进行硬编码的情况下从 buildscript 发送 Artifactory 发布凭据?

安卓工作室 : use one version number for all modules

java - Espresso 不等待 AsyncTask 完成

android - Xamarin (Android/iOS) 深度链接 - 通过 URL 打开应用程序(自定义与否)

android - 如何禁用Android Studio创建的Tabbed Activity模板中的 "swipe between tabs"?

android - 我在 kotlin 中使用 xml <include/> 标签时崩溃

java - 如何自动将 'implementation' 行添加到新项目