com.android.build.api.transform.TransformException: java.util.zip.ZipException: повторяющаяся запись: b.class - PullRequest
0 голосов
/ 01 января 2019

использовал Gradle для моего проекта Android.я недавно добавил несколько jars-файлов (и так далее). но после добавления thisi я получил ошибку сборки. Мой файл gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.myapplicationpck"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 44
        versionName "4.9"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }

    sourceSets {
        main.jni.srcDirs = []
        main.jniLibs.srcDirs = ['libs']
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/ASL2.0'
        exclude 'VERSION.txt'

    }

}

android {
    useLibrary 'org.apache.http.legacy'
}


repositories {
    mavenCentral()
    maven {
        url "https://jitpack.io"
    }
    maven {
        url 'https://maven.google.com'
    }

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile files('libs/android-viewbadger.jar')
    compile project(':libraryMobilePaymentSDK')
    compile('com.jakewharton:butterknife:8.6.0') {
        exclude module: 'support-compat'
    }
    compile 'xml-security:xmlsec:1.3.0'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.facebook.android:facebook-android-sdk:4.0.0'
    compile 'com.github.aakira:expandable-layout:1.4.2@aar'
    compile 'com.android.support:cardview-v7:24.2.1'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:recyclerview-v7:24.2.1'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'org.apache.httpcomponents:httpcore:4.4.1'
    compile 'org.apache.httpcomponents:httpclient:4.5'
    compile 'com.android.support:multidex:1.0.1'
    compile 'rongi.rotate-layout:rotate-layout:2.0.0'
    compile 'com.roomorama:caldroid:3.0.1'
    compile 'com.google.guava:guava:18.0'
    compile 'org.jsoup:jsoup:1.9.1'
    compile 'com.android.support.test.espresso:espresso-core:2.2.2'
    compile 'gun0912.ted:tedpermission:1.0.3'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.intuit.sdp:sdp-android:1.0.3'
    compile 'com.github.adhishlal:gifloader:1.1'
    compile('com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.2') {
        exclude group: 'com.google.zxing'
    }
    compile 'com.github.javiersantos:BottomDialogs:1.2.1'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'

// new added jar files

    compile files('libs/simple-xml-2.7.1.jar')
    compile files('libs/mpaysdk_release_v.1.0.4.jar')
    compile files('libs/jackson-core-asl-1.9.13.jar')
    compile files('libs/jackson-mapper-asl-1.9.13.jar')
    compile files('libs/bcprov-ext-jdk15on-154.jar')
    compile files('libs/commons-io-2.4.jar')
    compile files('libs/commons-lang-2.3.jar')
    compile files('libs/core-2.3.0.jar')
    compile files('libs/meSdk-3.6.4-SNAPSHOT7.jar')
    compile files('libs/rsadukpt.jar')


}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.jakewharton.butterknife'

теперь после сборки я получил ошибку, подобную этой:

Ошибка: выполнениене удалось выполнить задачу ': app: transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: повторяющаяся запись: b.class

как я могу решить эту проблему. Кто-нибудь, пожалуйста, помогите мне для преодоления этой проблемы. Спасибо заранее.

1 Ответ

0 голосов
/ 01 января 2019
compile project(':libraryMobilePaymentSDK')
compile files('libs/mpaysdk_release_v.1.0.4.jar')

Я думаю, что эти две библиотеки одинаковы.Если ДА, попробуйте удалить один из них и перестроить ваш проект.

...