关于okhttp(java.lang.NoSuchMethodError: No interface method rangeEquals(JLokio/ByteString;)Z)错误

错误信息:

E/AndroidRuntime: FATAL EXCEPTION: Thread-2322
                                                                       Process: cn.vove7.sendjsondemo, PID: 18952
                                                                       Theme: themes:{com.cyanogenmod.trebuchet=overlay:system, com.tencent.mobileqq=overlay:org.cyanogenmod.hexolibre, com.android.settings=overlay:system}
                                                                       java.lang.NoSuchMethodError: No interface method rangeEquals(JLokio/ByteString;)Z in class Lokio/BufferedSource; or its super classes (declaration of 'okio.BufferedSource' appears in /data/app/cn.vove7.sendjsondemo-1/split_lib_dependencies_apk.apk:classes15.dex)
                                                                           at okhttp3.internal.Util.bomAwareCharset(Util.java:412)
                                                                           at okhttp3.ResponseBody.string(ResponseBody.java:173)
                                                                           at cn.vove7.sendjsondemo.MainActivity.post(MainActivity.java:84)
                                                                           at cn.vove7.sendjsondemo.MainActivity.access$000(MainActivity.java:18)
                                                                           at cn.vove7.sendjsondemo.MainActivity$1$1.run(MainActivity.java:49)
                                                                           at java.lang.Thread.run(Thread.java:818)

由于使用的引用外部jar包,就一直出错,


    compile files('src/main/res/lib/okhttp-3.6.0.jar')
    compile files('src/main/res/lib/okio-1.6.0.jar')

换为gradle依赖即可


    compile 'com.squareup.okhttp3:okhttp:3.6.0'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值