毕加索在移动网络上获得jpeg解码错误

时间:2017-05-02 21:00:30

标签: android picasso android-glide decoding skia

我正在制作壁纸并在移动网络上使用Picasso加载图片时出错,重要的是同一张图片通过Wi-Fi完美加载! 我已经添加了更大的超时但问题仍然是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");

            }

这是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)

我在6台Android上使用Doogee x5max进行测试。图像不是很大550x550像素,而来自不同服务器的另一个图像具有相同的错误。 我已经尝试过Glide库并在移动网络上遇到同样的错误,所以我必须回到Picasso。  我认为问题在于移动连接,但如果超时没有帮助,那么如何解决它?

0 个答案:

没有答案
相关问题