Duplicate entry: com/google/android/gms/iid/zzc.cl

2020-08-01 07:52发布

问题:

While Trying to implement Admobs in project I m facing the below issue during build apk process.

Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/iid/zzc.class

build.gradle

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


android {   

configurations.all {
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'

}

defaultConfig {
    // ...
    multiDexEnabled true
}
dexOptions {
    jumboMode true
}
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "eazy.picsart"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 2
    versionName "2.0"
    testInstrumentationRunner 
   "android.support.test.runner.AndroidJUnitRunner"
    manifestPlaceholders = [appPackageName: "${applicationId}"]


   }

   buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
  }
  /* compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
   }*/

   /* 3) Exclude duplicate licenses */
  packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/DEPENDENCIES'
    pickFirst 'AndroidManifest.xml'
      exclude 'com/google/android/gms/ads/AdActivity.class'


   }

   aaptOptions{
    cruncherEnabled = false
   }
}

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'
})
 testCompile 'junit:junit:4.12'
 compile 'com.adobe.creativesdk.foundation:auth:0.9.1251'
compile 'com.adobe.creativesdk:image:4.8.4'
compile 'com.localytics.android:library:3.8.0'
compile 'com.android.support:appcompat-v7:23.1.1'


compile 'com.google.android.gms:play-services-ads:11.0.1'

  }