Duplicate files copied in APK META-INF/DEPENDENCIES

After the project goes online, how to reduce customers’ doubts about the delivery?Here is the secret script of three moves>>>

Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/DEPENDENCIES
  	File1: /home/dubox/dev/android/caiPiao/app/libs/httpcore-4.4.4.jar
  	File2: /home/dubox/dev/android/caiPiao/app/libs/httpclient-4.5.2.jar

Find the build.gradle file in the app directory and add the following information to the last side of the Android tag:

 packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }

Similar Posts: