码迷,mamicode.com
首页 > 移动开发 > 详细

Android Studio 运行出现 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

时间:2016-10-19 19:37:40      阅读:409      评论:0      收藏:0      [点我收藏+]

标签:

 

 

 


我引用compile ‘com.squareup.retrofit2:converter-jackson:2.1.0‘Gradle没有错误,运行APP就出了这个error。

 

 

错误日志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

 

 


解决方法如下:

 

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.3"
    defaultConfig {
        applicationId "com.edwin.xxxx"
        minSdkVersion 19
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile(proguard-android.txt), proguard-rules.pro
        }
    }

    packagingOptions{
        exclude META-INF/NOTICE // will not include NOTICE file
        exclude META-INF/LICENSE // will not include LICENSE file
        // as noted by @Vishnuvathsan you may also need to include
        // variations on the file name. It depends on your dependencies.
        // Some other common variations on notice and license file names
        exclude META-INF/notice
        exclude META-INF/notice.txt
        exclude META-INF/license
        exclude META-INF/license.txt
    }
}

 

 

 

技术分享

Android Studio 运行出现 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

标签:

原文地址:http://www.cnblogs.com/why168888/p/5978381.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!