glide icon indicating copy to clipboard operation
glide copied to clipboard

The huawei p30 or p30 pro Android 10 is particularly slow to load images, requiring a long wait before they are displayed or not displayed

Open LuckSiege opened this issue 4 years ago • 27 comments

use glide implementation 'com.github.bumptech.glide:glide:4.11.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

LuckSiege avatar Apr 09 '20 02:04 LuckSiege

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 Apr 17 '20 02:04 stale[bot]

I met the same problem on huawei devices, BUT other devices like XiaoMi,vivo can finish the job quickly ....

Microhx avatar Apr 17 '20 13:04 Microhx

how to fixed it ? I had the same problem

yangpeixing avatar Apr 21 '20 09:04 yangpeixing

try to use diskCacheStrategy(DiskCacheStrategy.NONE)

Microhx avatar Apr 24 '20 03:04 Microhx

This issue happened for on Huawei phones, but all Android 10!!! and no solution now.

The below code will stuck when calling decodeFileDescritor(), it's not always happen. Actually all the decode methods in BitmapFactory have such issue.

Bitmap bitmap = null; try(ParcelFileDescriptor pfd = context.getContentResolver().openFileDescriptor(uri, "r")) { if (pfd != null) { FileDescriptor fd = pfd.getFileDescriptor(); bitmap = BitmapFactory.decodeFileDescriptor(fd, null, options); } } catch (Exception e) { e.printStackTrace(); }

xiaos avatar Apr 26 '20 12:04 xiaos

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 May 03 '20 13:05 stale[bot]

I have this issue on my Nokia 7.2 (android 10) but everything is okay on Pixel 3a XL (android 10) same with version 4.10.0

After some time, some heavy inserting to MediaStore and several phone restarts the problem seems to be gone by itself

Artman12 avatar May 07 '20 07:05 Artman12

I wonder if it's better if the app has ACCESS_MEDIA_LOCATION (On Android 10/Q+)? I could imagine exif redaction making things slower

sjudd avatar May 08 '20 17:05 sjudd

Could this problem be a bug in huawei's system? Is it IO blocking? This occurs frequently when using the following API

context.getContentResolver().openFileDescriptor(uri,"r");

LuckSiege avatar May 11 '20 02:05 LuckSiege

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 May 19 '20 12:05 stale[bot]

Any ideas?

aaudin90 avatar May 22 '20 12:05 aaudin90

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 May 30 '20 02:05 stale[bot]

See https://github.com/bumptech/glide/issues/4174#issuecomment-625923930. Does adding that permission make it faster?

sjudd avatar Jun 02 '20 20:06 sjudd

I seems to have finally found the real cause to this problem, this issue is not limited to just some few manufacturers but to all the android 10 devices on a whole. Be it you are targeting api 28 and below or 29, if you are on android 10, then chances are you will encounter this issues.

The real issues seems to be coming out from MediaMetadataRetriver class of the native android system that glide uses it to retrieved thumbnails/videoframes from media file. This MediaMetadataRetriver class of android is so unreliable , that once it got stuck somewhere in the process of retrieving, the whole other retrieval process will queued up and remain stuck forever there until it recovered again from that stuck, thus leading to a huge list of blank images.

The only viable solution is - write your own glide module to retrieve thumbnails for video, FFmpegMediaMetadataRetrieval seems to be a very good and reliable alternative to the natively available built in android ones.

leephela avatar Jun 07 '20 02:06 leephela

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 Jun 14 '20 03:06 stale[bot]

same problem.

it looks as the system leave something opened (like some kind of filedescriptor). It looks as only happen when we are in debug mode (I'm not totally sure).

Reboot your huawei device, in my case it fixed the issue for some time.

sergiambel avatar Jun 16 '20 11:06 sergiambel

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 Jun 23 '20 13:06 stale[bot]

Any solution ? I encounter this problem on some devices on Android 10, hundreds of pictures not displayed.

LiuJQ avatar Nov 17 '20 11:11 LiuJQ

Issue is still relevant. This affects a lot of devices on android 10 including huawei. I'm using glide 4.11.0. Pictures from devices (uri like content://media/external/images/...) take a very long time to load after clearing the application cache. It can only be treated by rebooting the device.

faizrahmanovak avatar Jan 15 '21 06:01 faizrahmanovak

same issue on my Nokia 7 Plus (android 10), with glide version 4.11.0

LittleZombie avatar Jan 19 '21 02:01 LittleZombie

useless

lixbandroid avatar Dec 07 '21 09:12 lixbandroid

你发过来的邮件怎么都是乱码啊,什么都看不到,再发一次吧。

yiranLWS avatar Dec 07 '21 09:12 yiranLWS

Problem still exists on Android 10.

jerryisbusy avatar Dec 18 '21 11:12 jerryisbusy

Does somebody have a solution?

jerryisbusy avatar Dec 18 '21 11:12 jerryisbusy

This issue happened for on Huawei phones, but all Android 10!!! and no solution now.

The below code will stuck when calling decodeFileDescritor(), it's not always happen. Actually all the decode methods in BitmapFactory have such issue.

Bitmap bitmap = null; try(ParcelFileDescriptor pfd = context.getContentResolver().openFileDescriptor(uri, "r")) { if (pfd != null) { FileDescriptor fd = pfd.getFileDescriptor(); bitmap = BitmapFactory.decodeFileDescriptor(fd, null, options); } } catch (Exception e) { e.printStackTrace(); }

Agree with your opinion. I did a test and found that sometimes read() costs too much time. Do you have a solution now ?

jerryisbusy avatar Dec 18 '21 11:12 jerryisbusy

I'm very open to any workarounds anyone has found that we might be able to integrate. Maybe some kind of locking on huawei devices would help avoid this state.

For ffmpeg, I don't think we'd want to integrate it into the main library. But we could probably accept it as an integration library if someone wants to contribute.

sjudd avatar Feb 23 '22 01:02 sjudd

Try setting android:requestLegacyExternalStorage="true" in AndroidManifest

mayankmkh avatar May 02 '22 16:05 mayankmkh

Check the MANUFACTURER, if ("HUAWEI" == Build.MANUFACTURER && Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q), use load(filePath) , not to use load(uri)

BillyWei01 avatar Mar 03 '23 11:03 BillyWei01