In my Android app I'm using httpcore and httpmime libraries. My build.gradle files dependancy section contains below part,
compile 'org.apache.httpcomponents:httpcore:4.4.4'
compile 'org.apache.httpcomponents:httpmime:4.5.2'
and when I'm running the app gives an error. the log is as shown below,
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/NOTICE
File1: /Users/marpak/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.5.2/22b4c53dd9b6761024258de8f9240c3dce6ea368/httpmime-4.5.2.jar
File2: /Users/marpak/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.4.4/b31526a230871fbe285fbcbe2813f9c0839ae9b0/httpcore-4.4.4.jar
how can i fix this
add this in your build.gradle file
Better to use this one, it will include only one license file, some licenses (most of open source) do not allow to exclude license from final code:
It is not the best option since if you will have different license files with the same name you will loose one, but much better than exclude everything.