欢迎访问移动开发之家(rcyd.net),关注移动开发教程。移动开发之家  移动开发问答|  每日更新
页面位置 : > > > 内容正文

51.Rxjava+RxAndroid+Retrofit组合问题

来源: 开发者 投稿于  被查看 44826 次 评论:162

51.Rxjava+RxAndroid+Retrofit组合问题


51.Rxjava+RxAndroid+Retrofit组合问题

1.Caused by: java.lang.IllegalArgumentException: Unable to create call adapter for rx.Observable

fix :

compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'

this.retrofit = new Retrofit.Builder()
        .baseUrl(GankApi.BASE_URL)
        .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
        .addConverterFactory(GsonConverterFactory.create(this.gson))
        .client(okHttpClient)
        .build();

2.retrofit.HttpException: HTTP 404 Not Found

**fix : **retrofit2.0后:BaseUrl要以/结尾,@GET 等请求不要以/开头。


3.java.lang.AbstractMethodError: abstract method “retrofit.CallAdapter retrofit.CallAdapter$Factory.get

fix : 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1'
换为'com.squareup.retrofit:adapter-rxjava:2.0.0-beta2'


相关文章

    暂无相关文章

用户评论