retrofit2和rxjava2一起使用时的rxjava.jar版本冲突问题解决
来源:互联网 发布:c 加密解密算法 编辑:程序博客网 时间:2024/06/16 19:21
retrofit2和rxjava2一起使用时的rxjava.jar版本冲突问题解决
最近在升级rxjava到2.X.X版本的时候,发现出现rxjava1.x.x和rxjava2.x.x版本冲突
retrofit = new Retrofit.Builder() .baseUrl("https://xxx.xxx.com/") .addConverterFactory(GsonConverterFactory.create()) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .client(client) .build();
因为 RxJavaCallAdapterFactory 的库中有用到rxjava1.x.x版本的依赖
如果是rxjava1.x.x+retrofit2使用下面配置
compile 'io.reactivex:rxjava:1.1.1' compile 'io.reactivex:rxandroid:1.1.0' compile 'com.squareup.retrofit2:retrofit:2.2.0' compile 'com.squareup.retrofit2:converter-gson:2.2.0' compile 'com.squareup.retrofit2:adapter-rxjava:2.2.0'
如果是rxjava2.x.x+retrofit2使用下面配置
compile "io.reactivex.rxjava2:rxjava:2.0.8" compile 'io.reactivex.rxjava2:rxandroid:2.0.1' compile 'com.squareup.retrofit2:retrofit:2.2.0' compile 'com.squareup.retrofit2:converter-gson:2.2.0' compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0-RC3'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0-RC3'
这个库是在
compile 'com.squareup.retrofit2:adapter-rxjava:2.2.0'
的基础上修改的,内部其实就是把使用到rxjava1.x.x的地方修改到rxjava2.x.x
retrofit = new Retrofit.Builder() .baseUrl("http://xxx.xxx.com") .addConverterFactory(GsonConverterFactory.create()) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .client(client) .build();
10 0
- retrofit2和rxjava2一起使用时的rxjava.jar版本冲突问题解决
- RxJava2 和 Retrofit2 依赖时出现冲突
- Retrofit2和RxJava2的使用介绍一
- RxJava2和Retrofit2.0的简单使用
- RxJava2的使用以及RxJava2和RxJava的对比
- RxJava和Retrofit2.0的结合使用
- 【Android高级】RxJava2.0和Retrofit2.0的使用探究
- Rxjava2和Retrofit2网络库的封装
- retrofit2+rxjava的结合使用
- Retrofit2与RxJava的使用
- Android RxJava2+Retrofit2 依赖时出现冲突问题
- Retrofit2.0与RxJava2.0结合出现的问题解决
- retrofit2+rxjava+mockserver使用和理解
- Android使用Retrofit2.0和RxJava2.0处理网络请求
- Rxjava2.0和Retrofit2.0结合使用(2)post请求
- Retrofit2.0+RxJava+MVP+Bmob的使用
- 初学 retrofit2与RXJava 的搭配使用
- retrofit2兼容rxjava的配置和demo
- 老旧的钟表-水题
- 在Struts2中,使用绑定select进行页面查询
- angular2学习笔记(8)
- 数据库
- 114. Flatten Binary Tree to Linked List
- retrofit2和rxjava2一起使用时的rxjava.jar版本冲突问题解决
- ReactNative系列之十二图标组件react-native-vector-icons的使用
- java实现(2)-AVL树
- Ogre 获取显示鼠标位置
- 选择排序
- 二叉树的路径和
- 基于tomcat+windows配置虚拟主机(搭建网站)
- 分辨率 PPI DPI概念定义详解
- MVVM框架对比