Hello,
I've been testing with the newest Picasso version (2.2.0) and I have been getting these errors when I try loading images with Picasso:
"com.squareup.picasso.Downloader$ResponseException: 302 forced.302"
I am trying to load a listview with facebook profile images and it seems that out of 50 images, maybe only 10 actually get loaded with the rest returning that error. Any help would be appreciated, thanks
Which Downloader implementation is being used?
Or: paste the whole stack trace, please.
Hi, thanks for the response, I think I am using the default downloader since I did not specify one, this is how I have it setup:
Picasso.Builder builder = new Picasso.Builder(getApplicationContext());
builder.listener(new Picasso.Listener() {
@Override
public void onImageLoadFailed(Picasso arg0, android.net.Uri uri, Exception e)
System.out.println("picasso error: "+uri.toString() + ","+e.toString());
}
});
picasso = builder.build();
picasso.setDebugging(true);
and then in the listadapter:
String tt = "https://graph.facebook.com/"+gameData[3]+"/picture?type=square";
picasso.load(tt)
.resize(50,50)
.placeholder(R.drawable.blank2)
.into(rImage);
Thanks. Are you including the OkHttp jar into your app? Or are you just using Picasso by itself?
I am just using Picasso by itself. I can add the okhttp jar and test, is there a link to the jar file?
You can find a giant "Download" link near the bottom of http://square.github.io/okhttp/
ok great, I just did a test specifying the oktthp downloader ( builder.downloader(new OkHttpDownloader(getApplicationContext()));)
and it works great now and did not get any errors.
thanks for the help.
Sweet. This is because Picasso relies on the HTTP client to follow redirects. In general, everything about Picasso gets better when you are using OkHttp so I would recommend keeping it.
Also, you don't have to explicitly specify to use OkHttp. Just add the .jar to your app and Picasso will pick it up automatically. Of course, you are welcome to explicitly specify it if you want.
Hello Sir
I had same error occur and follow same as you have ask for
I am using com.squareup.picasso:picasso:2.5.2 and i have read comment "in version 2.5.2, Picasso is using OkHttp by default"
from this http://stackoverflow.com/a/24180040/1293313
OKHttp Jar : http://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.2.0/okhttp-3.2.0.jar
Error :
Error:(63, 29) error: cannot access OkHttpClient
class file for com.squareup.okhttp.OkHttpClient not found
Than how to use OkHttpDownloader?
Had the same problem as @milaptank , I sorted it by using this:
https://github.com/JakeWharton/picasso2-okhttp3-downloader
Picasso does include OkHttp, but it seems to be OkHttp3. The regular version of OkHttpDownloader seems to expect plain "OkHttp" (no "3"). So using OkHttp3Downloader fixed the issue for me!
Most helpful comment
Had the same problem as @milaptank , I sorted it by using this:
https://github.com/JakeWharton/picasso2-okhttp3-downloader
Picasso does include OkHttp, but it seems to be OkHttp3. The regular version of OkHttpDownloader seems to expect plain "OkHttp" (no "3"). So using OkHttp3Downloader fixed the issue for me!