I use Picasso library in my project to load images ande cache them. It works good without any problem. However, when I try to use OkHttp library to perform data communicatio
//Below code for Picasso initializing once for the app
private Picasso picasso;
private OkHttpClient okHttpClient;
okHttpClient = new OkHttpClient();
picasso = new Picasso.Builder(this)
.downloader(new OkHttpDownloader(okHttpClient))
.build();
//Below code to retrieve the images whereever required on the app
picasso.with(context).load(imageUrl).placeholder(R.drawable.ic_launcher)
The above code works fine for me.
Try these:
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.0.1'
If you're using eclipse IDE,in project properties->java build path->order and export (last tab) check the picasso library
I had the same errors. it worked for me, hope it helps.
Picasso uses 3 packages.
You want to add 2 times the OkHttp and OkIO package because of using the OkHttp library and the Picasso library.
The 2 packages are included in Picasso, you don't need to include the OkHttp library in your project.
Switch to Picasso 2.3.2. You'll also need okhttp-urlconnection-2.0.0-RC2.
This combination works for me:
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.squareup.picasso:picasso:2.4.0'