Sérgio Moura
Sérgio Moura

Reputation: 136

Error Parse 1.9.3 and OkHTTP 2.0.0

When I use version 1.9.3 of Parse (Parse-1.9.3.jar) and OkHTTP version 2.0.0 in the same project, I get this error:

java.lang.NoSuchMethodError: No virtual method setFollowRedirects(Z)V in class Lcom/squareup/okhttp/OkHttpClient; or its super classes (declaration of 'com.squareup.okhttp.OkHttpClient' appears in /data/app/XXXXXXXXXXX/base.apk:classes2.dex)

When I downgrade Parse to 1.9.2, everything works fine. Any idea of how to solve this?

Upvotes: 1

Views: 1082

Answers (2)

ElYeante
ElYeante

Reputation: 1755

If you are using a library that depends on an old version of OKHTTP (in my case, it is CreativeSDK), you will have this problem.

I just resolve it importing de last version of OkHTTP in gradle:

compile 'com.squareup.okhttp:okhttp:2.5.0'

Now, Parse is using this version of OkHTTP, while CreativeSDK uses its own version, and both are working.

Upvotes: 1

Sérgio Moura
Sérgio Moura

Reputation: 136

As Selvin said, Parse 1.9.3 uses OKHttp 2.1.0 (probably), so if you override it with OKHttp 2.0.0, you will have that error. You have 2 possibilities. Use Parse 1.9.3, and upgrade your OKHttp to some version newer than 2.0.0, or if you cannot upgrade your OKHttp, use Parse 1.9.2 instead.

Upvotes: 5

Related Questions