首页 > 代码库 > Error:duplicate files during packaging of APK app/build/output/apk

Error:duplicate files during packaging of APK app/build/output/apk

在gradle配置文件加入:

android {    packagingOptions {        exclude ‘META-INF/DEPENDENCIES.txt‘        exclude ‘META-INF/LICENSE.txt‘        exclude ‘META-INF/NOTICE.txt‘        exclude ‘META-INF/NOTICE‘        exclude ‘META-INF/LICENSE‘        exclude ‘META-INF/DEPENDENCIES‘        exclude ‘META-INF/notice.txt‘        exclude ‘META-INF/license.txt‘        exclude ‘META-INF/dependencies.txt‘        exclude ‘META-INF/LGPL2.1‘    }}

在运行一次APP即可以成功编译。

Error:duplicate files during packaging of APK app/build/output/apk