Android Studio 编译错误DuplicateFileException

来源:互联网 发布:wireshark抓包数据分析 编辑:程序博客网 时间:2024/04/30 04:05
在使用android studio编译遇到错误

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






在project级别的gradle文件中添加:
 packagingOptions {        exclude 'META-INF/DEPENDENCIES.txt'        exclude 'META-INF/DEPENDENCIES'        exclude 'META-INF/dependencies.txt'        exclude 'META-INF/LICENSE.txt'        exclude 'META-INF/LICENSE'        exclude 'META-INF/license.txt'        exclude 'META-INF/LGPL2.1'        exclude 'META-INF/NOTICE.txt'        exclude 'META-INF/NOTICE'        exclude 'META-INF/notice.txt'    }


1 0
原创粉丝点击