java.util.zip.ZipException: повторяющаяся запись: n.class - PullRequest
0 голосов
/ 29 мая 2018
  apply plugin: 'com.android.application'
android {
    compileSdkVersion 24
    buildToolsVersion "25.0.0"

    defaultConfig {
        applicationId "[ MY PACKAGE ]"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }


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

repositories {
    jcenter()
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'org.apache.httpcomponents:httpcore:4.4.1'
    compile 'org.apache.httpcomponents:httpclient:4.5'
    compile 'com.github.deano2390:android-viewbadger:1.0.0'
    compile('com.jakewharton:butterknife:8.6.0') {
        exclude module: 'support-compat'
    }
    compile project(':Library_MobilePaymentSDK')
    testCompile 'junit:junit:4.12'
    compile 'com.facebook.android:facebook-android-sdk:4.0.0'
    compile 'com.github.aakira:expandable-layout:1.4.2@aar'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.android.support:recyclerview-v7:24.2.1'
    compile 'com.android.support:cardview-v7:24.2.1'
    compile 'com.google.android.gms:play-services:10.0.0'
    compile 'com.google.firebase:firebase-messaging:10.0.0'
    compile 'com.google.firebase:firebase-core:10.0.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.android.support.test.espresso:espresso-core:2.2.2'
    compile 'rongi.rotate-layout:rotate-layout:2.0.0'
    compile 'com.roomorama:caldroid:3.0.1'
    compile 'com.maksim88:PasswordEditText:v0.9'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'gun0912.ted:tedpermission:1.0.3'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.jcmore2.appcrash:appcrash:1.1.0'
    compile 'com.github.stfalcon:smsverifycatcher:0.2'
    compile 'com.github.javiersantos:BottomDialogs:1.2.1'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
    compile files('libs/mpaysdk-sandbox-1.0.28.jar')
}

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

этот файл Gradle работает в API 21, но при запуске на API 19 произошла следующая ошибка.произошла следующая ошибка:

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

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

PLZ, помогите мне решить эту проблему.

1 Ответ

0 голосов
/ 29 мая 2018

Решение № 1:

В терминале Вы можете выполнить следующую команду в корневой папке проекта:

. / Gradlew clean

Решение № 2:

Если вы используете Android Studio, то это легко сделать, перейдите в Меню

Построить / очистить проект

Это будетобновить старые зависимости

Решение № 3:

Вы можете добавить следующий раздел в файл build.gradle:

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