AndroidHttpMockingExamples
AndroidHttpMockingExamples copied to clipboard
Gradle DuplicateFileException
Building the WireMock tests fails with
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebugAndroidTest'. > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE File1: /Users/ohad/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.8.0/45b426f7796b741035581a176744d91090e2e6fb/jackson-annotations-2.8.0.jar File2: /Users/ohad/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.8.5/60d059f5d2930ccd1ef03535b713fd9f933d1ba7/jackson-core-2.8.5.jar File3: /Users/ohad/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.8.5/b3035f37e674c04dafe36a660c3815cc59f764e2/jackson-databind-2.8.5.jar
I have fixed it by adding:
exclude group: 'com.fasterxml.jackson.core'
to WireMock build rule:
androidTestCompile("com.github.tomakehurst:wiremock:2.6.0") {
Now the tests fail at runtime
Did anyone find the solution for this problem ? I am also facing the same issue :(
@ohadnav & @kglondhe - I just pushed a TON of updates to the repo. Let me know if you still have any issues. Cheers.
After all the updates, I just ran all the tests and got: