Android Studio References AAR package file conflicts

Source: Internet
Author: User

development projects, more or less will introduce some third-party jar or AAR resource files, to facilitate the development of personalized features, but this will often occur in package conflicts, file conflicts, duplicate import resources or import two different packages contain the same file resources! Result of compilation failure, prompt error!
Here are the following to explain the problems I encountered and solutions:

1. file Conflict File Error prompt

Generally similar to this 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/maven/com.squareup.okio/okio/pom.xml file1:c:\users\wx_jin.gradle\caches\ Modules-2\files-2.1\com.squareup.okio\okio\1.6.0\98476622f10715998eacf9240d6b479f12c66143\okio-1.6.0.jar File2: D:\Android\workspace\wxj\YK\app\build\intermediates\exploded-aar\YK\umenglibrary\unspecified\jars\classes.jar
Tip Duplicate files copied in APK Meta-inf/maven/com.squareup.okio/okio/pom.xml
Repeat this file, we just need to get rid of one or ignore one.

Solution Solutions

Add build->android-> to the main project add packagingoptions exclude contain duplicate files

2. JAR Conflict conflict hint

Solution Solutions



Use this to ignore duplicate dependency packages

Android Studio references an AAR package file conflict

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.