您的位置:首页 > 移动开发 > Android开发

Error:duplicate files during packaging of APK E:\project\Android_studio_workspace\Browser\testzifuwe

2016-07-04 12:35 537 查看
使用架包httpclient-4.5.jar、httpcore-4.4.1.jar报如下异常时:

        Error:duplicate files during packaging of APK E:\project\Android_studio_workspace\Browser\testzifuweixin\build\outputs\apk\testzifuweixin-debug-unaligned.apk
Path in archive: META-INF/NOTICE

解决方案,在项目的build.gradle文件中的android添加如下代码:

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息