com.squareup.okhttp.HttpResponseCache无法解析符号' HttpResponseCache'

时间:2016-02-19 15:41:10

标签: android gradle httpresponsecache

我试图在Android Studio中编译导入的Android项目:

com.squareup.okhttp.HttpResponseCache

我收到错误"无法解析符号' HttpResponseCache' "

我尝试在gradle中添加以下依赖项但未成功:

compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.0'
compile 'com.squareup.okhttp:okhttp:2.7.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp3:okhttp:3.1.2'

我应该包含哪些库来使用HttpResponseCache?

2 个答案:

答案 0 :(得分:0)

根据documentation,您应该导入android.net.http

答案 1 :(得分:0)

在v1之后显然com.squareup.okhttp.HttpResponseCachedeprecated。我不认为它包含在v2.0.0之后的软件包中

如果您想使用它,请添加:

'com.squareup.okhttp:okhttp:1.6.0'