0
votes

I have downloaded the Jackson2 libraries to include in an android class. I get this error upon building:

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/LICENSE File1: \app\libs\jackson-core-2.9.1.jar File2: \app\libs\jackson-databind-2.9.1.jar File3: \app\libs\jackson-annotations-2.9.1.jar

I searched the internet and found this to be the most common answer:

packagingOptions {
    exclude  "META-INF/license.txt"
}

However, this doesn't fix the issue above.

1
tell me what you'v exclude in pakaging optionVishal Yadav

1 Answers

1
votes

You need to exclude the exact file name. From the error log, you can see that the duplicated file is META-INF/LICENSE (be aware of the case-sensitive) :

Duplicate files copied in APK META-INF/LICENSE

So, exclude it:

packagingOptions {
    exclude 'META-INF/LICENSE'
}