错误:任务’:app:transformResourcesWithMerge
JavaResForDevDebug’的执行失败.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK error_prone/Annotations.gwt.xml
File1: /Users/manmohansingh/.android/build-cache/c5c673e638724b8a150c9a07f761f05b8fef0253/output/jars/classes.jar
File2: /Users/manmohansingh/.gradle/caches/modules-2/files-2.1/com.google.ads.interactivemedia.v3/interactivemedia/3.6.0/76bc1544c67335c4bb38631001fd05a3e70004e4/interactivemedia-3.6.0.jar
解决方法
经过三个小时的挣扎得到了这个解决方案:将这些线加入
packagingOptions { exclude 'error_prone/Annotations.gwt.xml' exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml' exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml' }
最后 :
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/rxjava.properties' exclude 'error_prone/Annotations.gwt.xml' exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml' exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml' }