使用架包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'
}