如题,在使用 RxJava 开发的过程中,遇到了如下错误:
More than one file was found with OS independent path 'META-INF/rxjava.properties'
翻译过来就是有多个 rxjava.properties 文件,因此我们 exclude 掉就可以了, 在 android 闭包中添加如下代码即可:
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
一般出现这种问题是同时依赖的了 rxjava1 & rxjava2 的依赖,也包含不同版本的适配器。
implementation 'io.reactivex:rxjava:1.3.0'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.1'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
记忆:有 rxjava2 就是 2.x 否则就是 1.x 。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有