IllegalArgumentException: Could not locate call adapter for rx.Observable RxJava, Retrofit2

后端 未结 5 1376
野的像风
野的像风 2020-12-15 03:39

I am getting the above error while calling the rest api. I am using both retrofit2 and RxJava.

ServiceFactory.java

public class ServiceFactory {
pu         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 04:11

    For RxJava2 Use compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'

    .addCallAdapterFactory(RxJava2CallAdapterFactory.create())

    For more information on usage https://github.com/JakeWharton/retrofit2-rxjava2-adapter

提交回复
热议问题