Execution failed for task...More than one file was found with OS independent path'META-INF/rxjava...

项目导入第三方包的时候出现

Execution failed for task':app:transformResourcesWithMergeJavaResForDebug More than one file was found with OS independent path"META-INF/rxjava.properties'的错误,如下图所示:

查看Gradle Console打印的日志为:

解决方案是:

在app下的build.gradle的配置文件的android闭包中添加如下:

packagingOptions {
    //解决编译时com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'META-INF/rxjava.properties'这个错误
    exclude 'META-INF/rxjava.properties'
}

点击Sync Now同步一下重新编译OK。

发布了116 篇原创文章 · 获赞 165 · 访问量 17万+

猜你喜欢

转载自blog.csdn.net/qq_42618969/article/details/102783258
今日推荐