10424102 / whisky-android

0 stars 1 forks source link

Could not locate call adapter for rx.Observable<...> #16

Closed reliveyy closed 8 years ago

reliveyy commented 8 years ago

完整错误:java.lang.IllegalArgumentException: Could not locate call adapter for rx.Observable<...>>. Tried: * retrofit2.ExecutorCallAdapterFactory

reliveyy commented 8 years ago

引入依赖

compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta3'

添加配置

Retrofit retrofit = new Retrofit.Builder()
                //...
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                //...
                .build();

即可