Solved the problem of transformResourcesWithMergeJavaResForDebug,
1: rxjava is added. The following is the error message.
Error: Execution failed for task': newworldapp: transformresourceswithmergejavaresfordebug '.
> Com. android. build. api. transform. TransformException: com. android. builder. packaging. DuplicateFileException: Duplicate files copied in APK META-INF/rxjava. properties
File1: C: \ Users \ Administrator \. gradle \ caches \ modules-2 \ files-2.1 \ io. reactivex \ rxjava \ 1.2.1 \ 4e4cfa4adc74521d5966799fa5ab70b733552f68 \ rxjava-1.2.1.jar
File2: C: \ Users \ Administrator \. gradle \ caches \ modules-2 \ files-2.1 \ io. reactivex. rxjava2 \ rxjava \ 2.0.2 \ cfccdd18cdfbe7b4773d42c9f3512eeafbe5cbf9 \ rxjava-2.0.2.jar
Solution: add
PackagingOptions {
Exclude 'meta-INF/rxjava. properties'
//... And any other excludes go here
}
2:
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 File1: .gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.2.2\3c8f6018eaa72d43b261181e801e6f8676c16ef6\jackson-databind-2.2.2.jar File2: .gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.2.2\d20be6a5ddd6f8cfd36ebf6dea329873a1c41f1b\jackson-core-2.2.2.jar
File3: .gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\
Solution:
packagingOptions { exclude 'META-INF/NOTICE' // will not include NOTICE file exclude 'META-INF/LICENSE' // will not include LICENSE file}
3:
Error:Executionfailedfortask':app:transformResourcesWithMergeJavaResForUmengDebug'.
>com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:DuplicatefilescopiedinAPKMETA-INF/maven/com.belerweb/pinyin4j/pom.properties
File1:C:\Users\CYM\.gradle\caches\modules-2\files-2.1\com.belerweb\pinyin4j\2.5.0\5a620aedec0f779f2123ba60fd4b74bfbd3e2646\pinyin4j-2.5.0.jar
File2:C:\Users\CYM\.gradle\caches\modules-2\files-2.1\com.belerweb\pinyin4j\2.5.0\5a620aedec0f779f2123ba60fd4b74bfbd3e2646\pinyin4j-2.5.0.jar
Solution:
packagingOptions{
exclude'META-INF/maven/com.belerweb/pinyin4j/pom.xml'
exclude'META-INF/maven/com.belerweb/pinyin4j/pom.properties'
}