美文网首页程序员
Android Duplicate files copied i

Android Duplicate files copied i

作者: 木猫尾巴 | 来源:发表于2016-05-14 17:13 被阅读240次

    [TOC]

    问题表现

    Error:Execution failed for task ':bZSDK2_8:transformResourcesWithMergeJavaResForRelease'.
    > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/NOTICE.txt
      File1: /Users/sinlov/SourceTree/AS_7723/bZSDK2_8/libs/commons-lang.jar
      File2: /Users/sinlov/SourceTree/AS_7723/bZSDK2_8/libs/commons-codec-1.6.jar
    

    解决方法

    在报错的modulebuild.gradle设置

    android {
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
        }
    }
    

    具体META-INF后面填写的信息,查看报错日志¡

    相关文章

      网友评论

        本文标题:Android Duplicate files copied i

        本文链接:https://www.haomeiwen.com/subject/ctzmrttx.html