2017-06-01 24 views
5
Ben bu hata var API 21 ile telefonda benim güçlendirme API gözlemlenebilir kullanmak

:java.lang.NoClassDefFoundError: io.reactivex.Observable

java.lang.NoClassDefFoundError: io.reactivex.Observable 

ancak API 19 veya emülatörü ile telefonda API 23 çalışır.

Bu benim API Arayüz geçerli:

import io.reactivex.Observable; 
import retrofit2.Response; 
import retrofit2.http.Body; 
import retrofit2.http.POST; 
public interface ApiService { 
    /** 
    * Created by Mohsen on 5/10/2017. 
    * 
    */ 
    @POST("/cp/api/") 
    Observable<Response<Integer>> Get_BuyBox_Count(@Body Object request); 
} 

ve bu benim Güçlendirme ayarıdır:

@Provides 
    @Application_Scope 
    @Store_Retrofit_Qualifier 
    public Retrofit Store_retrofit(OkHttpClient client) { 
     return new Retrofit.Builder() 
       .baseUrl(Urls.Sotre_Base_Url) 
       .client(client) 
       .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) 
       .addConverterFactory(JSONConverterFactory.create()) 
       .addConverterFactory(GsonConverterFactory.create()) 
       .build(); 
    } 

benim Bağımlılıklar: Son olarak

compile 'com.squareup.retrofit2:retrofit:2.2.0' 
    compile 'com.squareup.retrofit2:converter-gson:2.1.0' 
    compile 'io.reactivex.rxjava2:rxjava:2.0.1' 
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1' 
    compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' 
+0

ile Constrainlayout

compile 'com.android.support.constraint:constraint-layout:1.0.2' 

ile Rxjava çakışıyor? – akarnokd

+0

@akarnokd Benim multidex uygulama ve gradle tamam –

cevap

3

, sonra çözüm buldular.

sorun multidex var mı

compile 'io.reactivex:rxjava:1.2.6' 
İlgili konular