只加okhttp的包 会报错 并且 软件崩溃,停止运行
原因是 没有加okio的包
02-23 12:08:44.410 30388-30473/? E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.example.caisiyu.okhttp, PID: 30388
java.lang.NoClassDefFoundError: Failed resolution of: Lokio/Okio;
at okhttp3.internal.io.RealConnection.connectSocket(RealConnection.java:144)
at okhttp3.internal.io.RealConnection.connect(RealConnection.java:111)
at okhttp3.internal.http.StreamAllocation.findConnection(StreamAllocation.java:188)
at okhttp3.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:127)
at okhttp3.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
at okhttp3.internal.http.HttpEngine.connect(HttpEngine.java:289)
at okhttp3.internal.http.HttpEngine.sendRequest(HttpEngine.java:241)
at okhttp3.RealCall.getResponse(RealCall.java:240)
at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:198)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:160)
at okhttp3.RealCall.access 100 ( R e a l C a l l . j a v a : 30 ) a t o k h t t p 3. R e a l C a l l 100(RealCall.java:30) at okhttp3.RealCall 100(RealCall.java:30)atokhttp3.RealCallAsyncCall.execute(RealCall.java:127)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor W o r k e r . r u n ( T h r e a d P o o l E x e c u t o r . j a v a : 636 ) a t j a v a . l a n g . T h r e a d . r u n ( T h r e a d . j a v a : 764 ) C a u s e d b y : j a v a . l a n g . C l a s s N o t F o u n d E x c e p t i o n : D i d n ′ t f i n d c l a s s " o k i o . O k i o " o n p a t h : D e x P a t h L i s t [ [ z i p f i l e " / d a t a / a p p / c o m . e x a m p l e . c a i s i y u . o k h t t p − D y O z N p K 2186 v i 93 k f Y m A h g = = / b a s e . a p k " ] , n a t i v e L i b r a r y D i r e c t o r i e s = [ / d a t a / a p p / c o m . e x a m p l e . c a i s i y u . o k h t t p − D y O z N p K 2186 v i 93 k f Y m A h g = = / l i b / a r m 64 , / s y s t e m / l i b 64 , / s y s t e m / v e n d o r / l i b 64 ] ] a t d a l v i k . s y s t e m . B a s e D e x C l a s s L o a d e r . f i n d C l a s s ( B a s e D e x C l a s s L o a d e r . j a v a : 93 ) a t j a v a . l a n g . C l a s s L o a d e r . l o a d C l a s s ( C l a s s L o a d e r . j a v a : 379 ) a t j a v a . l a n g . C l a s s L o
记一次 okhttp的坑
最新推荐文章于 2024-07-08 03:09:49 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)