安卓Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

版权声明:本文为博主原创文章,转载请注明。 https://blog.csdn.net/qq_34698126/article/details/74781850
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\\.gradle\caches\modules-2\files-2.1\io.reactivex.rxjava2\rxjava\2.0.4\cbcf91e47e43607fb628b11b3571f212f11a6f84\rxjava-2.0.4.jar

    File2: C:\Users\\.gradle\caches\modules-2\files-2.1\io.reactivex\rxjava\1.1.5\ece7b5d0870e66d8226dab6dcf47a2b12afff061\rxjava-1.1.5.jar  


这个问题是由于项目内有重复jar包或者文件冲突造成,在要打包的module的build.gradle添加代码:

packagingOptions {
    exclude 'META-INF/rxjava.properties'  //这里找到你自己错的那行,把Duplicate files copied in APK后面的复制上来
}




猜你喜欢

转载自blog.csdn.net/qq_34698126/article/details/74781850
今日推荐