Search code examples
androidpicasso

Unable to download image using Picasso on Android


I'm trying to download the following image using Picasso https://s3-media4.fl.yelpcdn.com/bphoto/94E7Ti0RTDbA6mGotZw5DA/o.jpg

I can see it fine in a browser. However when I attempt to download it using Picasso, I get an error (a breakpoint in my onError() method gets hit).

This is an extract of my code:

final RequestCreator rc = with(context).load(fullImagePath);

if (fit != null && fit) {
    rc.fit();
}

// If no callback listener exists, create one.
if (callbackListener == null) {
    callbackListener = new Callback() {

        @Override
        public void onSuccess() {
            L.p("onSuccess retrieving " + fullImagePath);
        }

        @Override
        public void onError() {
            // Something went wrong
            L.p("Error retrieving " + fullImagePath);
        }

    };
}

rc.into(fImageView, callbackListener);

I found this: https://github.com/square/picasso/issues/500 however it's a bit dated and the OkHttpClient class no longer has the setProtocols() method.

Thanks!


Solution

  • Inserting that link as "http" instead of "https" will work.