错误:java.util.zip.ZipException:重复条目 [英] Error: java.util.zip.ZipException: duplicate entry

查看:36
本文介绍了错误:java.util.zip.ZipException:重复条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向我的项目添加一个库,现在我当前的 build.gradle 是:

I'm trying to add a library to my project, right now my current build.gradle is:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    repositories {
        mavenCentral()
    }

    defaultConfig {
        applicationId "com.example.guycohen.cheaters"
        minSdkVersion 11
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
            // Enabling multidex support.
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.facebook.android:facebook-android-sdk:4.0.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.whl.handytabbar:library:1.0.4'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.easing:library:1.0.1@aar'
    compile 'com.daimajia.androidanimations:library:1.1.3@aar'
}

当我添加一个新库时

compile 'com.github.navasmdc:PhoneTutorial:1.+@aar'

我收到此错误:

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry:      android/support/v4/print/PrintHelperKitkat$2$1.class

我已尝试通过添加来解决此问题

I've tried to fix this issue by adding

configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }

我在我的项目中找不到重复的类.

I couldn't find a duplicate class in my project.

我确定是否可以删除重复的条目,它会完美运行,但我不确定如何找到它.

I'm sure whether if I could delete the duplicate entry it would run perfectly, but I'm not sure how I'd find it.

推荐答案

compile 'com.android.support:support-v4:22.1.1'
compile ('com.android.support:appcompat-v7:22.1.1') {
    exclude module: 'support-v4'
}
compile ('com.facebook.android:facebook-android-sdk:4.2.0') {
    exclude module: 'support-v4'
}
compile ('com.github.navasmdc:PhoneTutorial:1.+@aar') {
    exclude module: 'support-v4'
}

这篇关于错误:java.util.zip.ZipException:重复条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆