handstandsam / AndroidHttpMockingExamples

"androidTest" Examples for WireMock 2.x and okhttp MockWebServer 3.x
Apache License 2.0
40 stars 11 forks source link

Gradle DuplicateFileException #2

Open ohadnav opened 7 years ago

ohadnav commented 7 years ago

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") {

ohadnav commented 7 years ago

Now the tests fail at runtime

kglondhe commented 7 years ago

Did anyone find the solution for this problem ? I am also facing the same issue :(

handstandsam commented 7 years ago

@ohadnav & @kglondhe - I just pushed a TON of updates to the repo. Let me know if you still have any issues. Cheers.

handstandsam commented 7 years ago

After all the updates, I just ran all the tests and got:

screen shot 2017-09-17 at 9 41 06 pm