错误:任务':packageAllReleaseClassesForMultiDex'执行失败

时间:2016-01-31 19:59:14

标签: android android-studio gradle android-gradle

帮助!它是我的.gradle文件:

 buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.3.0'
        }
    }
    allprojects {
        repositories {
            jcenter()
        }
    }
    apply plugin: 'com.android.application'
    android {
        compileSdkVersion 23
        buildToolsVersion "22.0.1"

        defaultConfig {
            applicationId "test.app.android.player"
            minSdkVersion 15
            targetSdkVersion 23
            multiDexEnabled true
        }

        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }
        }

        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
    }

    repositories {
    }
    dependencies {
        compile files('libs/android-support-v4-22.2.1.jar')
        compile files('libs/android-support-v7-recyclerview-22.2.1.jar')
        compile files('libs/applovin-6.1.5.jar')
        compile files('libs/appodeal-1.14.6.jar')
        compile files('libs/chartboost-6.2.0.jar')
        compile files('libs/flurry-analytics-6.2.0.jar')
        compile files('libs/inmobi-5.2.0.jar')
        compile files('libs/my-target-4.2.0.jar')
        compile files('libs/unity-ads-1.4.7.jar')
        compile files('libs/yandex-metrica-2.30.jar')
        compile 'com.google.android.gms:play-services-ads:8.4.0'
        compile 'com.android.support:multidex:1.0.0'
    }
    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v4'
    }

我在logcat中遇到此错误,请参阅:错误:任务':packageAllReleaseClassesForMultiDex'的执行失败。

  

java.util.zip.ZipException:重复条目:android / support / v4 / view / PagerAdapter.class

我找不到重复的

1 个答案:

答案 0 :(得分:0)

你必须删除

justify-content: center;

compile files('libs/android-support-v4-22.2.1.jar') 'com.google.android.gms:play-services-ads:8.4.0'有依赖关系。通过这种方式,您可以使用不同的版本添加两个相同的类。