今天添加fresco的gradle引发了如下的错误:
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.nineoldandroids/library/pom.xml
File1: C:\BaiduShareFolder\TR0100\app\libs\NineOldAndroids-2.4.0.jar
File2: C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\com.nineoldandroids\library\2.4.0\e9b63380f3a242dbdbf103a2355ad7e43bad17cb\library-2.4.0.jar
解决办法:
AndroidStudio 2.0 preview
android{
packagingOptions {
exclude 'META-INF/maven/com.nineoldandroids/library/pom.xml'
exclude 'META-INF/maven/com.nineoldandroids/library/pom.properties'
// exclude 'META-INF/maven/com.belerweb/pinyin4j/pom.xml'
// exclude 'META-INF/maven/com.belerweb/pinyin4j/pom.properties'
}
}
把这个没啥用的东西剔除就好啦~