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

来源:互联网 发布:大数据怎么用 编辑:程序博客网 时间:2024/05/10 06:20

如题,在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

0 0
原创粉丝点击