Glide: Can't load image from net on 4.7.1

Created on 3 Aug 2018  Â·  6Comments  Â·  Source: bumptech/glide



Glide 4.7.1

Device: Xiaomi 5A


I couldn't reproduce it in clean environment - I've got a list, in which I load url. If I use hardcoded url, it works, If I use Glide 4.4.0 (as mentioned in issue #2824:) it works. But if I use dynamic url on 4.7.1, it throws exception.


Glide load line:

Timber.w("binding image: '%s'", image);
Glide.with(binding.bgImage)
    .load(image.trim())//not working (tried with/without trim())
//    .load("https://ms-dev.beeline.uz/binaries/content/gallery/mainsite/backgrounds-all/1200x600_bravo-online.jpg")//working
    .into(binding.bgImage);


Layout XML:

<ImageView
    android:id="@+id/bg_image"
    android:layout_width="match_parent"
    android:layout_height="160dp"
    android:scaleType="centerCrop"
    android:src="@drawable/sample" />


Stack trace / LogCat:

BalanceViewHolder: binding image: 'https://ms-dev.beeline.uz/binaries/content/gallery/mainsite/backgrounds-all/1200x600_status-bonusi-news.jpg'
W/Glide: Load failed for https://ms-dev.beeline.uz/binaries/content/gallery/mainsite/backgrounds-all/1200x600_status-bonusi-news.jpg with size [656x320]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There was 1 cause:
    java.lang.IndexOutOfBoundsException(Index: 0, Size: 0)
     call GlideException#logRootCauses(String) for more detail
      Cause (1 of 1): class java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
08-03 11:36:31.228 5804-5804/uz.beeline.my I/Glide: Root cause (1 of 1)
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.get(ArrayList.java:411)
        at java.util.Collections$UnmodifiableList.get(Collections.java:1295)
        at com.bumptech.glide.load.engine.ResourceCacheGenerator.startNext(ResourceCacheGenerator.java:71)
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:302)
        at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:269)
        at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:233)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:760)
        at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)

bug

Most helpful comment

Update: still occurs on version 4.8.0
W/Glide: Load failed for https://ms-dev.beeline.uz/binaries/content/gallery/mainsite/icons/internet/internet-web-sites.svg with size [32x32] class com.bumptech.glide.load.engine.GlideException: Failed to load resource

All 6 comments

Let me know if you find a way to reproduce this, even if it's somewhat flaky. Example urls would help.

same problem when app first installedï¼›
but glide work when open again after kill appï¼›

Update: still occurs on version 4.8.0
W/Glide: Load failed for https://ms-dev.beeline.uz/binaries/content/gallery/mainsite/icons/internet/internet-web-sites.svg with size [32x32] class com.bumptech.glide.load.engine.GlideException: Failed to load resource

We're having this issue as well. Any updates?

@sepehr1014 we ended up making a workaround with manual svg loading/caching:
https://gist.github.com/ildar2/806715ce1c26c4d274fe532e2e7532e4

Sharp svg can accept InputStream: https://github.com/Pixplicity/sharp

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sant527 picture sant527  Â·  3Comments

Anton111111 picture Anton111111  Â·  3Comments

sergeyfitis picture sergeyfitis  Â·  3Comments

Morteza-Rastgoo picture Morteza-Rastgoo  Â·  3Comments

FooBarBacon picture FooBarBacon  Â·  3Comments