Not able to run build in Android: Even in Debug mode

53 views Asked by At

I can understand that there are some library files duplicate. But I am not able to locate and fix it!..

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: /root/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.7.3/e250c11c1329c7b6b62442a9743befad78be553c/jackson-annotations-2.7.3.jar
File2: /root/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.7.2/84ffa765dd258dbab8695963c41308b054f3a1cb/jackson-databind-2.7.2.jar
File3: /root/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.7.3/1499b854ae9f370409792db5af1b552dc7d9682f/jackson-core-2.7.3.jar

The path /root/.gradle/caches/mod.... is showing my gradle location on my machine. I tried of deleting it. But If I sync my project again all the three gradle files are created locally.

1

There are 1 answers

0
firegloves On BEST ANSWER

add this to your app build.gradle into android block

packagingOptions {
    exclude 'META-INF/LICENSE'
}

May be after this you will be notified with similar problems related to other files. Keep excluding new files until you can build