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

Android Studio工程Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.错误

2017-04-14 17:51 691 查看
如题,在AS编apk的时候,报了如下错误:

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/LICENSE
File1: C:\Users\G\AndroidStudioProjects\SuperMapGTMobile1\app\libs\poi-3.9-20121203.jar
File2: C:\Users\G\AndroidStudioProjects\SuperMapGTMobile1\app\libs\poi-scratchpad-3.9-20121203.jar

意思是在poi-3.9-20121203.jar   poi-scratchpad-3.9-20121203.jar两个jar包中APK META-INF/LICENSE 重复了,借鉴了网上的修改方法,我的解决办法如下:

在app的build.gradle中的

android {
...
defaultConfig {
applicationId "com.supermap.gtmobile"
minSdkVersion 15
targetSdkVersion 17
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/LICENSE'
}

...
}

添加了
packagingOptions {
exclude 'META-INF/LICENSE'
}
意思不要包含 META-INF/LICENSE
参考链接:
http://stackoverflow.com/questions/34031395/errorexecution-failed-for-task-apptransformresourceswithmergejavaresfordebug
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐