java.util.zip.ZipException:重复条目:android / support / v7 / view / ActionMode $ Callback.class

时间:2015-07-20 09:04:06

标签: android android-gradle executable-jar

我在Android工作室导入一个项目,所以我的build.gradle文件如下。

的build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.pkg.name"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
   }
 }

dependencies {
compile files('libs/achartengine-1.1.0.jar')
compile files('libs/apache-mime4j-0.6.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/droidText.0.2.jar')
compile files('libs/gson-2.1.jar')
compile files('libs/httpmime-4.0.1.jar')
compile files('libs/itextpdf-5.1.0.jar')
compile files('libs/json_simple-1.1.jar')
compile files('libs/opencsv-2.4.jar')
compile files('libs/ormlite-android-4.48.jar')
compile files('libs/ormlite-core-4.48.jar')
compile files('libs/google-play-services.jar')
compile files('libs/android-support-v7-appcompat.jar')
compile 'com.android.support:appcompat-v7:22.2.0'
}

当我运行我的项目时,它给出了如下错误:

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: android/support/v7/view/ActionMode$Callback.class

我知道如何解决这个问题?你的所有建议都很明显。

1 个答案:

答案 0 :(得分:2)

您已将appcompat库包括两次:

compile files('libs/android-support-v7-appcompat.jar')
compile 'com.android.support:appcompat-v7:22.2.0'

另请注意,您需要为multidex支持进行一些其他调整:https://developer.android.com/tools/building/multidex.html