Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
2016-04-05 15:51
507 查看
So I'm continuously receiving a gradle build error upon trying to run my project. I have searched for other solutions and some say that adding:
packagingOptions { exclude 'META-INF/NOTICE' }to my app's gradle.build would fix the issue, however, it doesn't. Here is what my app's gradle.build currently looks like.
apply plugin: 'com.android.application'apply plugin: 'com.google.gms.google-services'dependencies {compile fileTree(include: ['*.jar'], dir: 'libs')compile 'com.google.android.gms:play-services:8.3.0'compile 'com.google.android.gms:play-services-ads:8.3.0'compile 'com.google.android.gms:play-services-identity:8.3.0'compile 'com.firebase:firebase-client-android:2.3.1'}android {compileSdkVersion 23buildToolsVersion '23.0.1'useLibrary 'org.apache.http.legacy'defaultConfig {applicationId "com.example.j.airportmeet"minSdkVersion 18targetSdkVersion 23versionCode 1versionName "1.0"multiDexEnabled true}packagingOptions { exclude 'META-INF/NOTICE' }buildTypes {release {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}EDIT: The full error is this:
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: .gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.2.2\3c8f6018eaa72d43b261181e801e6f8676c16ef6\jackson-databind-2.2.2.jar File2: .gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.2.2\d20be6a5ddd6f8cfd36ebf6dea329873a1c41f1b\jackson-core-2.2.2.jar
File3: .gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\
解决方法:As the error message suggests you are not excluding the
META-INF/LICENSEfile which exists in more than one of your dependenciescom.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
packagingOptions {exclude 'META-INF/NOTICE' // will not include NOTICE fileexclude 'META-INF/LICENSE' // will not include LICENSE file}
相关文章推荐
- Android中的Toast创建
- Android提权漏洞CVE-2014-7920&CVE-2014-7921分析
- Android日志处理相关
- UI设计理念-app的界面设计流程
- android5.0 activity动画
- iTween基础之Color(变换颜色)
- iOS--项目目录组织及生成脚本
- Android_LIFE帮(基于最新百度地图API的开源项目)
- [安卓开发笔记一]Android开发配置opencv环境超详细教程
- 从源码解析Android中View的容器ViewGroup
- Android动态部署四:如何从插件apk中启动Activity(二)
- ios app: 使用企业license设置发布app的过程
- 管理照相机-拍照(摘自Android官方培训课程中文版(v0.9.5))
- 退出 android 应用程序
- proguard混淆
- Swift三种操作:is、as?和as!
- iOS 16进制与10进制的互转
- Android 实现对软键盘(收起和弹出)的监听
- 他们都没告诉你适配 Android N 需要注意什么
- 安卓AS开发 cause failed to find target android-14