2017-01-19 91 views
3

我正在請求與OkHttp3,RetroFit 2.0 + RxObservable的JSON文件,它拋出接口沒有實現。這似乎只發生在運行我們的應用程序的舊版本並升級到最新的應用程序版本的Android 4.3用戶上。致命 - 接口沒有實現 - OkHttp3 - Android

01-19 16:43:31.089 1611-1692/? E/AndroidRuntime: FATAL EXCEPTION: IntentService[MyDataIntentService] 
            java.lang.IncompatibleClassChangeError: interface not implemented 
             at okhttp3.internal.Util.closeQuietly(Util.java:100) 
             at okhttp3.internal.connection.StreamAllocation.streamFailed(StreamAllocation.java:332) 
             at okhttp3.internal.http.RetryAndFollowUpInterceptor.recover(RetryAndFollowUpInterceptor.java:209) 
             at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:132) 
             at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
             at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
             at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212) 
             at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
             at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
             at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179) 
             at okhttp3.RealCall.execute(RealCall.java:63) 
             at retrofit2.OkHttpCall.execute(OkHttpCall.java:174) 
             at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:144) 
             at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:125) 
             at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50) 
             at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) 
             at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50) 
             at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) 
             at rx.Observable.subscribe(Observable.java:8759) 
             at rx.Observable.subscribe(Observable.java:8726) 
             at rx.Observable.subscribe(Observable.java:8581) 
             at com.somepackage.someclass.loadSomeJSONThing(MyFile.kt:61) 

這裏的電話:

//get returns Observable<Any> 
myApi.getSomeObj("some_id") 
    .subscribe({ responseHandler(it) }, 
       { Crashlytics.logException(it) }) 

回答

2

我覺得這是一個OkHttp迴歸。我們錯誤地認爲Socket實現了Closeable,舊設備的情況並非如此。很快就會修復。

Fixed here:https://github.com/square/okhttp/pull/3125

+0

我該如何在平均時間內處理這個錯誤? –

+0

對於API 16,我無法嘗試捕獲資源 –

+0

@TimNuwin您無法使用快照,或者您可以等待下一個構建。 –

相關問題