I am using Retrofit-1.6.0
+ okhttp-2.0.0-RC1
in my project .
when i run the project i get the error.
java.lang.RuntimeException: Retrofit detected an unsupported OkHttp on the classpath.
To use OkHttp with this version of Retrofit, you'll need:
1. com.squareup.okhttp:okhttp:1.6.0 (or newer)
2. com.squareup.okhttp:okhttp-urlconnection:1.6.0 (or newer)
Note that OkHttp 2.0.0+ is supported!
Anybody knows how to fix this?
Even with OkHTTP 2 you need to import the urlConnection extra
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
Ok, square has released 2.0 RC2 on github, but not on maven:
https://github.com/square/okhttp
But you still need okhttp-urlconnection (RC1) which is only on maven:
http://mvnrepository.com/artifact/com.squareup.okhttp
And don't forget okhttp 2.0 is now dependent on okio:
https://github.com/square/okio
I had picasso/Retrofit complaning the same way you do. This configuration worked for me:
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With