1

I'm making the wallpaper and have an error while loading image using Picasso on mobile network, important thing that the same image is loading perfectly via wi-fi! I have added the bigger timeout but problem is still percist:

            OkHttpClient okHttpClient;
            okHttpClient = new OkHttpClient();
            okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);

            Picasso    picasso = new Picasso.Builder(LiveService.this)
                    .downloader(new OkHttpDownloader(okHttpClient))
                    .build();
            try{
            bitmap = picasso.with(LiveService.this)
                    .load(url)
                    .get( );

            } catch (IOException e) {
                e.printStackTrace();
                Log.d("TAG", "Load IOException");

            }

This is logcat:

D/skia: --- SkImageDecoder::Factory returned null
05-02 23:32:07.630 4704-8037/jpro.com.Servicelive W/System.err: java.io.IOException: Failed to decode stream.
05-02 23:32:07.631 4704-8037/jpro.com.Servicelive W/System.err:     at com.squareup.picasso.BitmapHunter.decodeStream(BitmapHunter.java:145)
05-02 23:32:07.631 4704-8037/jpro.com.Servicelive W/System.err:     at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:217)
05-02 23:32:07.631 4704-8037/jpro.com.Servicelive W/System.err:     at com.squareup.picasso.RequestCreator.get(RequestCreator.java:396)

I'm testing on Doogee x5max with 6 Android. Image is not big 550x550 px and another images from different servers has the same error. I have tried the Glide library and get the same error on mobile network so I have to returned back to Picasso. I think the problem is in mobile connection but if timeout doesn't help then how to fix it?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Alisa
  • 23
  • 4
  • if someone will have the same problem: I have tried to "increase buffer "in BitmapHunter class of Picasso as many advised in other topics: from private static final int MARKER = 65536; to private static final int MARKER = 131072; i did it but it wasn't worked for me. I'll continue to search the way to fix. – Alisa May 03 '17 at 10:04

0 Answers0