user3504453
user3504453

Reputation: 1791

com.squareup.okhttp.HttpResponseCache Cannot resolve symbol 'HttpResponseCache'

I'm trying to compile an Android project in Android Studio which imports:

com.squareup.okhttp.HttpResponseCache

I'm getting an error "Cannot resolve symbol 'HttpResponseCache' "

I've tried adding in the gradle the following dependencies without success:

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'

Which library/s should I include to use HttpResponseCache?

Upvotes: 0

Views: 399

Answers (2)

RaGe
RaGe

Reputation: 23657

Apparently com.squareup.okhttp.HttpResponseCache was deprecated after v1. I do not see it included in the package after v2.0.0

If you want to use it, add:

'com.squareup.okhttp:okhttp:1.6.0'

Upvotes: 0

Mathias Berwig
Mathias Berwig

Reputation: 508

According to the documentation, you should import android.net.http.

Upvotes: 0

Related Questions