1. 解决依赖包冲突
android解决okhttp依赖冲突,如 weex依赖okhttp2,腾讯cos依赖okhttp3,这两个依赖的okio版本不一致导致了冲突。可在引用第三方库的时候,不引用其中的 okio模块,具体如下:
compile 'com.squareup.okhttp:okhttp-ws:2.3.0'
compile 'com.squareup.okio:okio:1.13.0' compile 'com.squareup.okhttp3:okhttp:3.8.1' //COS依赖
compile ('com.squareup.okhttp:okhttp:2.3.0',{
//Weex依赖
exclude module: "okio" //(原依赖的是1.3.0改为依赖高版本1.13.0)
})