Retrofit does not recognize adapter

0

Error:

 Caused by: java.lang.IllegalArgumentException: Could not locate call adapter for rx.Observable<java.util.List<pojo.Professional>>.
                    Tried:
                     * com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
                     * retrofit2.ExecutorCallAdapterFactory
                      at retrofit2.Retrofit.nextCallAdapter(Retrofit.java:241)
                      at retrofit2.Retrofit.callAdapter(Retrofit.java:205)
                      at retrofit2.ServiceMethod$Builder.createCallAdapter(ServiceMethod.java:235)
                        ... 19 more

Api:

public interface ProfessionalApi {

    @GET("/api/v1/professional/search/{job}")
    Observable<List<Professional>> fetchAllProfessionalByCode(@Path("job") String job);

Provider Retrofit

public static Retrofit provideRetrofit() {
    final String serverAddress = Constants.BASE_URL;
    final String authKey = Constants.API_KEY;

    return new Retrofit.Builder()
            .baseUrl(serverAddress)
            .addConverterFactory(GsonConverterFactory.create(provideGson()))
            .addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
            .client(provideOkHttpClient(authKey))
            .build();
}

Call:

professionalApi.fetchAllProfessionalByCode(filter)
        .filter(professionals -> !professionals.isEmpty())
        .flatMap(mProfessionalRepository::save)

Apparently not recognizing the adapter passed on

addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
    
asked by anonymous 25.08.2018 / 20:32

0 answers