title: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml
body: <p>I am creating one app that uses a RestAPI to fetch data, and for that operation I am using retrofit 2, okhttp3 and jackson for parsing json to object, my app also use Firebase Cloud Messaging </p>
  
  <p>when I compile my code it gives me following error &amp; I can't able to run it</p>
  
  <p>Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.</p>
  
  <blockquote>
    <p>com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml
        File1: /Users/silent/work/silentinfotech/DoorEye/app/libs/jackson-databind-2.7.2.jar
        File2: /Users/silent/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.2.2/3c8f6018eaa72d43b261181e801e6f8676c16ef6/jackson-databind-2.2.2.jar</p>
  </blockquote>
  
  <p>I am using <strong>Android Studio 2.1.1</strong> and  <strong>OS X El Capitan 10.11.2</strong></p>
  
  <p>some Library added in projects libs folder </p>
  
  <p><a href="http://mvnrepository.com/artifact/com.squareup.retrofit2/converter-jackson/2.0.2" rel="nofollow noreferrer">converter-jackson-2.0.2.jar</a></p>
  
  <p><a href="http://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations/2.7.0" rel="nofollow noreferrer">jackson-annotations-2.7.0.jar</a></p>
  
  <p><a href="http://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core/2.7.2" rel="nofollow noreferrer">jackson-core-2.7.2.jar</a></p>
  
  <p><a href="http://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind/2.7.2" rel="nofollow noreferrer">jackson-databind-2.7.2.jar</a></p>
  
  <p>My build.gradle file</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.2"
  
      defaultConfig {
          applicationId "com.silentinfotech.dooreye"
          minSdkVersion 17
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
          multiDexEnabled true
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      packagingOptions {
  
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/NOTICE'
  
      }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.4.0'
     // compile 'com.android.support:support-v4:23.4.0'
      compile 'com.google.firebase:firebase-messaging:9.0.0'
      compile 'com.firebase:firebase-client-android:2.5.1+'
     // compile 'com.github.bumptech.glide:glide:3.7.0'
      compile 'com.squareup.retrofit2:retrofit:2.0.2'
      compile 'com.squareup.okhttp3:okhttp:3.2.0'
      compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
  
  }
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>I also tried adding following in my build.gradle file but it don't work for me </p>
  
  <pre><code>packagingOptions {              
  exclude 'META-INF/LICENSE'         
  exclude 'META-INF/NOTICE'          
  }
  </code></pre>
  
  <p>also tried invalidate caches &amp; restart, and also rebuild, clean, even I tried with manually deleting caches but still its give me error </p>
  
  <p>I am using firebase Cloud  messaging in my project when I remove all the dependency of Firebase Cloud Messaging  then project successfully run but when I add FCM dependency it always give error.</p>