Android Gradle duplicate files copied exception
<p>I have seen many versions of this question where the solution is to simply exclude the META-INF file name, but those are already excluded and the duplicate file, in this case, is not even a file associated with META-INF. When I run ./gradlew --stacktrace it compiles fine, but if I run the application on a device, the app crashes with the duplicate file warning.</p>

<pre><code>apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "24.0.3"
defaultConfig {
    applicationId "rocks.morrisontech.historicsf"
    minSdkVersion 19
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/license'
}

dependencies {

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.socrata:soda-api-java:0.9.12'
compile 'com.google.code.findbugs:jsr305:2.0.1'
testCompile 'junit:junit:4.12'
// play-services imports
compile 'com.google.android.gms:play-services-maps:10.0.1'

}
</code></pre>

<blockquote>
  <p>FAILURE: Build failed with an exception.</p>
</blockquote>

<ul>
<li><p>What went wrong:
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 com/sun/jersey/impl/api.properties
  File1: /Users/Quinn/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-core/1.9.1/cf6c0f8b945081fca5f5eb7417d10d58cefd7035/jersey-core-1.9.1.jar
  File2: /Users/Quinn/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-bundle/1.9.1/67d37c4e80633a0196b733886441855201742a65/jersey-bundle-1.9.1.jar</p>
</blockquote></li>
<li><p>Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.</p></li>
</ul>

<p>I have noticed jersey is a dependency of com.socrata:soda-api-java:0.9.12, and when I delete that dependency I have no issues. I have also tried to use the soda-android-api, but that came with similar issues.</p>