在android studio中添加.jar文件后,clean、

2016-05-12  本文已影响536人  莫比乌丝环丶

报如下错误:

Error: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

解决方案:

在project下的build.gradle下的android下或者在android下Gradle Scripts 下的 bueld.gradle(Module: app)添加

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'

}

上一篇下一篇

猜你喜欢

热点阅读