【问题标题】:Duplicate files copied in APK META-INF/maven/com.nineoldandroids/library/pom.xml在 APK META-INF/maven/com.nineoldandroids/library/pom.xml 中复制的重复文件
【发布时间】:2016-09-01 04:30:24
【问题描述】:

FAILURE:构建失败并出现异常。

  • 出了什么问题: 任务 ':transformResourcesWithMergeJavaResForDebug' 执行失败。

    com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:在 APK META-INF/maven/com.nineoldandroids/library/pom.xml 中复制的文件重复 文件 1:D:\STUDIO\Mobility_Android\FFS\build\intermediates\exploded-aar\FFS\ShowCaseViewLibrary\unspecified\jars\classes.jar 文件2:D:\STUDIO\Mobility_Android\FFS\build\intermediates\exploded-aar\FFS\AndroidBetterPickers\unspecified\jars\classes.jar

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

构建失败

【问题讨论】:

    标签: android eclipse android-studio compiler-errors libraries


    【解决方案1】:

    将此添加到您的 build.gradle 文件中

    android {
        packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/maven/com.nineoldandroids/library/pom.xml' 
        exclude 'META-INF/maven/com.nineoldandroids/library/pom.properties'
        }
    }
    

    【讨论】:

    • 通过添加这些行解决了我的问题.. android { packagingOptions { exclude 'META-INF/maven/com.nineoldandroids/library/pom.xml' exclude 'META-INF/maven/com.nineoldandroids /library/pom.properties' } 从下面的 url stackoverflow.com/questions/37428636/… 得到这个
    • 好的,我已经更新了我的答案。如果有帮助,请接受。谢谢
    猜你喜欢
    • 2016-04-11
    • 2017-03-30
    • 2016-09-22
    • 2016-08-10
    • 2016-12-27
    • 2017-11-14
    • 2017-12-08
    • 1970-01-01
    相关资源
    最近更新 更多