RXJAVA Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

错误:

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/rxjava.properties
  	File1: C:\Users\Fashionaly\.gradle\caches\modules-2\files-2.1\io.reactivex.rxjava2\rxjava\2.0.7\21734c0092a5d3c3ec99510e50c1ff76bdf0c65a\rxjava-2.0.7.jar
  	File2: C:\Users\Fashionaly\.gradle\caches\modules-2\files-2.1\io.reactivex\rxjava\1.2.1\4e4cfa4adc74521d5966799fa5ab70b733552f68\rxjava-1.2.1.jar

解决:

android{
    packagingOptions {
        exclude 'META-INF/rxjava.properties'
    }
}
原因:Duplicate files copied in APK META-INF/rxjava.properties

因为相同的Jar包里边的配置文件冲突了,所以给他过滤掉问题解决。

猜你喜欢

转载自blog.csdn.net/lvwenbo0107/article/details/80909561
今日推荐