glide icon indicating copy to clipboard operation
glide copied to clipboard

Cannot load some URL (intermittent)

Open emarc-m opened this issue 9 years ago • 24 comments

Glide Version:4.0.0-RC0

Integration libraries:Failed on stock and OKHTTP integration, works on Picasso 2.5.2 and Glide 3.8.0

Device/Android Version:Sony Xperia J1 4.4.4

Issue details / Repro steps / Use case background: Most URL works fine, but some URL fails to load intermittently, see error logs section. Sample image url: https://lh3.googleusercontent.com/NSVbWbdKFGRzju5r5XsXKMJ9A41PVdWNhGSxDwxk9aO6o_7SeVMU8z27-GhdNw3uS0PZtLPts5tvaxdsHr--NRXZWfyi=s300

Glide load line / GlideModule (if any) / list Adapter code (if any):

@GlideModule
public final class CustomGlideModule extends AppGlideModule {
}

            Glide.with(this)
                     .load("https://lh3.googleusercontent.com/NSVbWbdKFGRzju5r5XsXKMJ9A41PVdWNhGSxDwxk9aO6o_7SeVMU8z27-GhdNw3uS0PZtLPts5tvaxdsHr--NRXZWfyi=s300")
                     .placeholder(R.drawable.bg_image_default_light)
                     .into(holder.image);

Layout XML:

<RelativeLayout
            android:id="@+id/image_container"
            android:layout_width="match_parent"
            android:layout_height="@dimen/image_height"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/ticket_header_container">

            <ImageView
                android:id="@+id/image"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="centerCrop"
                tools:src="@drawable/bg_image_default_light"/>

</FrameLayout>

Stack trace / LogCat:

06-15 16:34:28.638 15903-15903/com.anytimes.android.debug W/Glide: Load failed for https://storage.googleapis.com/static.anytimes.jp/images/categories/88-ok.jpg with size [318x188]
                                                                   class com.bumptech.glide.load.engine.GlideException: Failed to load resource
                                                                     Cause (1 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Object->Drawable}, DATA_DISK_CACHE, https://storage.googleapis.com/static.anytimes.jp/images/categories/88-ok.jpg
                                                                       Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->Drawable}
                                                                       Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Bitmap->Drawable}
                                                                       Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->BitmapDrawable->Drawable}
                                                                     Cause (2 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Object->Drawable}, DATA_DISK_CACHE, https://storage.googleapis.com/static.anytimes.jp/images/categories/88-ok.jpg
                                                                       Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->Drawable}
                                                                       Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->Bitmap->Drawable}
                                                                       Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->BitmapDrawable->Drawable}
                                                                     Cause (3 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor->Object->Drawable}, DATA_DISK_CACHE, https://storage.googleapis.com/static.anytimes.jp/images/categories/88-ok.jpg
                                                                       Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->Bitmap->Drawable}
                                                                       Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->BitmapDrawable->Drawable}
                                                                     Cause (4 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Object->Drawable}, REMOTE, https://storage.googleapis.com/static.anytimes.jp/images/categories/88-ok.jpg
                                                                       Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->Drawable}
                                                                       Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Bitmap->Drawable}
                                                                       Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->BitmapDrawable->Drawable}
                                                                     Cause (5 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Object->Drawable}, REMOTE, https://storage.googleapis.com/static.anytimes.jp/images/categories/88-ok.jpg
                                                                       Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->Drawable}
                                                                       Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->Bitmap->Drawable}
                                                                       Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->BitmapDrawable->Drawable}
                                                                     Cause (6 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor->Object->Drawable}, REMOTE, https://storage.googleapis.com/static.anytimes.jp/images/categories/88-ok.jpg
                                                                       Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->Bitmap->Drawable}
                                                                       Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->BitmapDrawable->Drawable}
06-15 16:34:28.638 15903-15903/com.anytimes.android.debug E/Glide: class com.bumptech.glide.load.engine.GlideException: Failed to load resource

emarc-m avatar Jun 15 '17 07:06 emarc-m

I have the same problem. If you have solved this problem, I hope you can help me

lm11000 avatar Jun 20 '17 05:06 lm11000

@lm11000 I had to disable all transition animations.

emarc-m avatar Jun 20 '17 08:06 emarc-m

Same problem with different situation. When load from local server,ok, otherwise, failed. Glide.with(context).load(url_local).into(iv) works, Glide.with(context).load(url_server).into(iv) failed. v4.0.0-RC0

edit: local_url: http://192.168.1.204:8888 remote_url: http://192.168.1.208:8888 proxy_url: http://api.some.com:80 => http://192.168.1.208:8888

(1) when use local_url(port:8888), App can load image correctly; (2)when use remote_url(port:8888), App can not load image correctly; (3)when use proxy_url(port:80),App can load image correctly.

I don't know why. Caused by port?

sitexa avatar Jun 29 '17 04:06 sitexa

I had faced same issue, but was resolved when removed asGif().

geniushkg avatar Aug 03 '17 07:08 geniushkg

it's working with me: Glide.with(context) .load(new URL(your_image)) .into(image)

tvhieuit avatar Aug 14 '17 17:08 tvhieuit

Same issue here. Regarding the device, I am either able to download the image (nexus 5x) or not (galaxy s5). I am using Glide 4.1.1. Any update on it ?

paulVulog avatar Sep 19 '17 12:09 paulVulog

@tvhieuit that also worked for me! Thank you very much! Previously I used url as string, not as URL object

Pynop avatar Sep 21 '17 19:09 Pynop

@tvhieuit Thank you, use your approach to solve my problem, but why should this be done?

jayleco avatar Sep 30 '17 17:09 jayleco

@tvhieuit thank you ! that was helpful

rafikkm avatar Nov 10 '17 14:11 rafikkm

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

stale[bot] avatar Nov 17 '17 14:11 stale[bot]

I'm not sure what using new URL would fix. Using new URL() on the main thread will introduce performance problems and isn't generally recommended.

sjudd avatar Nov 17 '17 15:11 sjudd

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

stale[bot] avatar Nov 24 '17 15:11 stale[bot]

//Im try in activity screen it work also

compile 'com.github.bumptech.glide:glide:4.2.0'

Glide.with(this)
	.load("https://png.pngtree.com/element_origin_min_pic/17/01/04/15d80cc97cadf95f17258bc849b67b36.jpg")
        .disallowHardwareConfig()
	.into(ivTryGlide)

tvhieuit avatar Dec 02 '17 04:12 tvhieuit

In my case,my url string has lots of redundant space.Just use trim() method to delete them will work.

lbb1993 avatar Jan 02 '18 03:01 lbb1993

It happened on some phones with 8.1 system.

I setup this to solve the issue.

Glide.with(this) .load(url) .disallowHardwareConfig() .into(iv)

Hope to help more

viyski avatar Jul 04 '18 10:07 viyski

我的情况是第一次安装打开app的时候没有问题 第二次修改图片有就有问题了

e9ab98e991ab avatar Sep 29 '18 09:09 e9ab98e991ab

Somehow @tvhieuit 's solution works for me.

devmike01 avatar Feb 14 '19 13:02 devmike01

Glide v 4.9.0 load pictures no display ?

example

Glide.with(context).load(url).into(imageView);

H-mate1001 avatar Feb 26 '19 05:02 H-mate1001

Removing DrawableTransitionOptions worked for me.

bineeshbabu avatar Jul 01 '19 20:07 bineeshbabu

Though my path is correct and I am able to open the image, I couldn't load it using a string. I had to use URL and the below worked: Glide.with(context) .load(new URL(path)) .into(imageView)

but load(URL url) is deprecated so using Uri instead worked: it's working with me: Glide.with(context) .load(Uri.Parse(path)) .into(imageView)

nmanuchintapalli avatar Oct 18 '19 18:10 nmanuchintapalli