【问题标题】:DuplicateFileException m4b + play services 9.0DuplicateFileException m4b + 播放服务 9.0
【发布时间】:2016-10-03 13:42:22
【问题描述】:

错误:任务 ':app:transformResourcesWithMergeJavaResFor' 执行失败。

com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: 在 APK jsr305_annotations/Jsr305_annotations.gwt.xml 中复制的文件重复 File1:\app\build\intermediates\exploded-aar\google-maps-sdk-m4b\jars\classes.jar File2:\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-basement\9.0.0\jars\classes.jar

【问题讨论】:

    标签: android google-play-services


    【解决方案1】:

    android{} 部分内的build.gradle 中添加以下文本以解决问题。

    android {
    ...
        packagingOptions {
            exclude  'jsr305_annotations/Jsr305_annotations.gwt.xml'
            exclude  'build-data.properties'
         }
    ...
    }
    

    如果出现更多错误 DuplicateFileException 添加带有排除的文件。 喜欢:

    错误

    Duplicate files copied in APK jsr305_annotations/Jsr305_annotations.gwt.xml 
    

    解决方案

    exclude  'jsr305_annotations/Jsr305_annotations.gwt.xml'
    

    【讨论】:

      【解决方案2】:

      将此添加到您的 gradle 文件将解决您的问题:

      packagingOptions {
          exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml'
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-01-04
        • 2019-02-15
        • 1970-01-01
        • 2014-08-18
        • 2017-02-13
        • 2014-05-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多