RxAndroid с дооснащением 2.0

у меня есть интерфейс

 @GET("/data, 2.5/forecast/daily")
   Observable<MultilingualWeather> getWeatherByIdWithMultilingual(
    @Query("id") String id,
    @Query("lang") String lang,
    @Query("appid") String appid);

MainActivity вызываться в следующей конфигурации

 Retrofit retrofit_weather = new Retrofit.Builder().
        baseUrl(BASE_URL).
        addConverterFactory(GsonConverterFactory.create()).
        addCallAdapterFactory(RxJavaCallAdapterFactory.create()).
        build();

GetWeatherForLocation getWeather = retrofit_weather.create(GetWeatherForLocation.class);

Observable<MultilingualWeather> call_observable = getWeather.
            getWeatherByIdWithMultilingual(
            CITY_ID,
            LANG,
            KEY
    );

    subscription = call_observable.subscribe(subscriber);

Следующие зависимости файлов

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'io.reactivex:rxjava:1.0.16'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1'

}

и после всего этого вылетает исключение

 FATAL EXCEPTION: main Process: com.example.alex.weatherclient, PID: 16658 java.lang.AbstractMethodError: abstract method "retrofit.CallAdapter retrofit.CallAdapter$Factory.get(java.lang.reflect.Type, java.lang.annotation.Annotation[], retrofit.Retrofit)"         

person Oleksandr    schedule 03.12.2015    source источник
comment
Вы случайно не использовали разные версии для какой-либо из ваших модифицированных зависимостей? Возможно связанные вопросы и ответы.   -  person MH.    schedule 03.12.2015
comment
да, у меня такая же проблема, я попробую перейти на beta2 и посмотреть, решит ли это проблему.   -  person issamux    schedule 21.12.2016


Ответы (2)


Заменить в build.gradle

compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1' 

on

compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta2'
person VeteR_OK    schedule 06.12.2015

похоже на опечатку. Ваш интерфейс использует getWeatherByIdWithMultilingual, а ваш код использует getWeatherByIdWithMultilingual2

person EnduroDave    schedule 03.12.2015