ZipException:转换重复项com / google / android / gms / internal / zzez.class

时间:2018-06-28 11:48:24

标签: java android gradle build.gradle transform

当我尝试构建APK时,显示以下消息:

  

错误:任务执行失败   ':app:transformClassesWithJarMergingForDebug'。

     
    

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复项:     com / google / android / gms / internal / zzez.class

  

但是当我尝试调试应用程序时,此工作正常。

我已删除.gradle目录,但未成功。

这是我的build.gradle应用程序文件:

buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'me.tatarka:gradle-retrolambda:3.2.2'
        classpath 'io.fabric.tools:gradle:1.21.4'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'

android {
    compileSdkVersion 24
    buildToolsVersion '26.0.2'

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
        exclude 'META-INF/NOTICE'
    }

    aaptOptions {
        useNewCruncher false
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.DringMe.launcher.fr"
        minSdkVersion 19
        targetSdkVersion 23
        multiDexEnabled true
    }

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

    repositories {
        maven {
            url 'http://repo.appspanel.com/appspanel-sdk-android/'
        }
        maven {
            url 'https://jitpack.io'
        }
    }

    dexOptions {
        incremental true
        javaMaxHeapSize "3g"
    }
    dependencies {
        compile 'com.squareup.retrofit:retrofit:1.9.0'
        compile 'com.squareup.retrofit:converter-simplexml:1.9.0'

        compile 'com.jakewharton:butterknife:7.0.1'
       // annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'


        //noinspection GradleCompatible
        compile 'com.android.support:design:24.2.1'
        //noinspection GradleCompatible
        compile 'com.google.android.gms:play-services-location:11.6.0'
        compile 'com.google.android.gms:play-services-maps:11.6.0'
        compile 'io.reactivex:rxandroid:1.0.1'
        compile 'de.greenrobot:eventbus:2.4.0'
        compile 'com.github.bumptech.glide:glide:3.7.0'
        compile 'com.pkmmte.view:circularimageview:1.1'
        compile 'com.nineoldandroids:library:2.4.0'
        compile 'com.github.sd6352051.niftydialogeffects:niftydialogeffects:1.0.0@aar'
        compile 'com.hannesdorfmann.smoothprogressbar:library:1.0.0'
        compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.0'

        compile files('src/main/libs/edm.jar')
        compile files('src/main/libs/rc.jar')
        compile files('src/main/libs/cdm.jar')
        compile files('src/main/libs/license.jar')
        compile files('src/main/libs/knox.jar')


        compile 'com.github.arimorty:floatingsearchview:2.0.3'
        //noinspection GradleDependency
        compile 'com.google.maps.android:android-maps-utils:0.4+'
        //noinspection GradleDependency
        compile 'com.akexorcist:googledirectionlibrary:1.0.4'
        compile project(':slideDateTimePicker-release')
        compile 'me.biubiubiu.justifytext:library:1.1'
        //noinspection GradleDependency
        compile 'com.android.support:multidex:1.0.1'


        compile project(':AppsPanelSDK')
      //  compile 'com.appspanel.android:sdk:4.4.2'
    }
}

configurations {
    compile.exclude group: 'stax'
    compile.exclude group: 'xpp3'
}

dependencies {
    compile project(':SmartAdServer-Android-SDK-6.7.1')
    //    compile project(':AppsPanelSDK')

}

我不知道为什么会这样,我被困住了。

我需要帮助!!

谢谢。

2 个答案:

答案 0 :(得分:0)

最后,我或多或少地解决了我的问题:

我替换

 compile 'com.google.android.gms:play-services-location:11.6.0'
    compile 'com.google.android.gms:play-services-maps:11.6.0'

收件人

compile 'com.google.android.gms:play-services-location:11.0.4'
    compile 'com.google.android.gms:play-services-maps:11.0.4'

答案 1 :(得分:0)

taskkill /f /t /im java.exe
timeout /t 30
pushd "tomcatHome\bin\"
call startup.bat