代码中遇到的问题

09-11 12:12:19.973 8929-8929/com.example.administrator.myapplication D/DDD: =====HHHHH
09-11 12:12:20.024 8929-8929/com.example.administrator.myapplication W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
09-11 12:12:20.266 8929-8986/com.example.administrator.myapplication E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
                                                                                       Process: com.example.administrator.myapplication, PID: 8929
                                                                                       java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Platform;
                                                                                           at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:109)
                                                                                           at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:157)
                                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
                                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
                                                                                           at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
                                                                                           at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)
                                                                                           at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                                                                                           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                                           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)

                                                                                           at java.lang.Thread.run(Thread.java:818)

使用HttpLoggingInterceptor时遇到了问题,发现是因为Okhttp的版本不匹配。

 compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'  //gson要添加一致的版本
    compile 'com.squareup.okhttp3:okhttp:3.9.0'
//    compile 'com.squareup.okhttp3:okhttp:3.4.1'
//    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
应改成下面 注释掉的。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值