- Android Studio: 2.2.2
- Gradle: 2.2.2
I have this common problem but the usual solutions don't seem to be helping. I've even broken it down to just this one library on a new solution. To replicate, fire up a new Android project and simply drop this one line into your dependencies.
compile 'com.sun.jersey:jersey-client:1.13'
Here is the error.
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/jersey-module-version File1: /Users/me/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-client/1.13/ec38c57a78940bf5f8f5971307ca89406849647/jersey-client-1.13.jar File2: /Users/me/.gradle/caches/modules-2/files-2.1/com.sun.jersey/jersey-core/1.13/4326a56dc6b2d67b7313905c353e1af225bb164f/jersey-core-1.13.jar
I have tried
- https://stackoverflow.com/a/20675325/316614
- https://stackoverflow.com/a/20698598/316614
- Error :: duplicate files during packaging of APK
I can't figure out what to exclude. Has anybody see this? Easy to replicate, try it out.
META-INF/jersey-module-version
? Because none of those answers say that – OneCricketeer