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