Solved the problem of transformResourcesWithMergeJavaResForDebug,

Source: Internet
Author: User

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:
  1. Error:Executionfailedfortask':app:transformResourcesWithMergeJavaResForUmengDebug'.
  2. >com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:DuplicatefilescopiedinAPKMETA-INF/maven/com.belerweb/pinyin4j/pom.properties
  3. File1:C:\Users\CYM\.gradle\caches\modules-2\files-2.1\com.belerweb\pinyin4j\2.5.0\5a620aedec0f779f2123ba60fd4b74bfbd3e2646\pinyin4j-2.5.0.jar
  4. File2:C:\Users\CYM\.gradle\caches\modules-2\files-2.1\com.belerweb\pinyin4j\2.5.0\5a620aedec0f779f2123ba60fd4b74bfbd3e2646\pinyin4j-2.5.0.jar

    Solution:

    1. packagingOptions{
    2. exclude'META-INF/maven/com.belerweb/pinyin4j/pom.xml'
    3. exclude'META-INF/maven/com.belerweb/pinyin4j/pom.properties'
    4. }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.