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

后端 未结 5 1378
野的像风
野的像风 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条回答
  •  南笙
    南笙 (楼主)
    2020-12-15 04:19

    From the said Github project page:

    Blockquote This is now DEPRECATED! Retrofit 2.2 and newer have a first-party call adapter for RxJava 2: https://github.com/square/retrofit/tree/master/retrofit-adapters/rxjava2

    now you just need to include in your app/build.gradle file:

    compile 'com.squareup.retrofit2:adapter-rxjava2:latest.version'
    

提交回复
热议问题