当前位置: 首页 > 知识库问答 >
问题:

zipException:重复条目:com/google/zxing/barcodeformat.class

卫建义
2023-03-14

我不知道为什么我会得到这个错误。任何帮助都是值得赞赏的

Error:Execution failed for task ':packageAllDebugClassesForMultiDex'.

zipException:重复条目:com/google/zxing/barcodeformat.class

apply plugin: 'android'

buildscript{repositories{mavenCentral()}dependencies{classpath“com.android.tools.build:Gradle:1.3.0”}}allprojects{repositories{jcenter()maven{url“http://releases.payworks.io/artifactory/mpos”}}}android{compileSdkVersion 23 buildToolsVersion“23.0.2”useLibrary“org.apache.http.Legacy”

android 
{
    packagingOptions 
    {
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'LICENSE.txt'
    }
}

defaultConfig 
{        
    multiDexEnabled true
}
dexOptions {
    javaMaxHeapSize "2g"
}
sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    instrumentTest.setRoot('tests')        
    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')
}

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile 'io.card:card.io:5.0.1@aar'
    compile project(':star')
    compile project(':zxing-android-embedded')
    compile 'io.payworks:mpos.android.ui:2.7.0:@aar'
    compile 'io.payworks:mpos.android.core:2.7.0:@aar'
    compile 'io.payworks:mpos.android.accessories.miura:2.7.0:@aar'
    compile 'io.payworks:mpos.android.comlinks.bluetooth:2.7.0:@aar'
    compile 'io.payworks:mpos.android.accessories.verifone-e105:2.7.0:@aar'
    compile 'io.payworks:mpos.android.comlinks.verifone-e105:2.7.0:@aar'
    compile 'io.payworks:mpos.android.accessories.sewoo:2.7.0:@aar'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.squareup:otto:1.3.5'
    compile 'com.squareup.okhttp:okhttp:2.7.2'
    compile 'com.parse.bolts:bolts-android:1.2.1'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.4.4'
    compile 'com.verifone:verifone-pwmadk:3.0.2@aar'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.google.android.gms:play-services-identity:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
}
dexOptions {
    preDexLibraries = false
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}
}

共有1个答案

长孙高远
2023-03-14

我不确定它是否管用,但您可以尝试使用duplicationstrategy(https://docs.gradle.org/current/javadoc/org/gradle/api/file/duplicatesstrategy.html),如下所示:

packageAllDebugClassesForMultiDex {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
 类似资料: