RxAndroid and Retrofit: Unable to create call adapter for io.reactivex.Observable<retrofit2.Response<okhttp3.ResponseBody>>
You are using RxJava1 adapter for Retrofit, replace it with RxJava2 variant:
//compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
UPDATE
Starting with Retrofit version 2.2.0
there is a first-party call adapter for RxJava2:
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
Update : May/2020
New adapter for RxJava 3
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
RxJava3CallAdapterFactory.create()
instead of RxJava2CallAdapterFactory.create()
Update : June/2019
Rxjava version is updated to 2.2.10
compile 'io.reactivex.rxjava2:rxandroid:2.1.1'
compile 'io.reactivex.rxjava2:rxjava:2.2.10'
compile 'com.squareup.retrofit2:retrofit:2.6.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.6.0'
Also Retrofit requires at minimum Java 7 or Android 2.3
------------------------------------------
For new comers (July/2017) :
You messed your library version for sure.
I have been using latest version of RXAndroid 2.0.1
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
1) Make sure you have same Retrofit and Retrofit-RxJava Adapters.
2) Use compile
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
not
compile 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
and use RxJava2CallAdapterFactory.create()
instead of RxJavaCallAdapterFactory.create()
while building retrofit.