-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
on Android 10 (Q) , Glide failed to load image from Image from local storage #3896
Comments
I have found workaround for above issue on below link <application
|
https://developer.android.com/training/data-storage/files/external-scoped It's complicated unfortunately :/. The other option is to try to open images using MediaStore Uris rather than file paths. |
This is solve by passing Uri instead of string in load method of glide, just like this
|
Thanks man, working perfect. |
Add android:usesCleartextTraffic="true" in Manifest will start working |
Sorry this won't work. This tag is used for allowing HTTP ( cleartext network traffic) endpoint in App. |
Is there solution for this error``` W/Glide: Load failed for https://firebasestorage.googleapis.com/v0/b/mfree-9290a.appspot.com/o/uploads%2F1585227800859.null?alt=media&token=b8954c84-f1c7-4c9d-b94e-c76bece7b1c6 with size [120x120]
|
* IconicsContextWrapper is crashing * fix `GROUP BY` query hack * workaround fix for Android 10 Glide failed to load image * see bumptech/glide#3896
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 got 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 native built in android ones. |
i have error log like this 2020-08-12 18:19:30.825 23777-23777/com.kotlin.githubuser W/Glide: Load failed for https://avatars3.githubusercontent.com/u/121695?v=4 with size [200x200] |
use SAF @Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
switch (requestCode) {
case 0:
Glide.with(MainActivity.this)
.load(data.getData())
.into(iv);
break;
default:
break;
}
}
} |
Unfortunately, you can't factory Uri like that instead of this : val uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id) |
For me, problem was that Uri parse method was failing as it missed "file://" prefix :
This is the right way to do it :
|
I too had blank images, during my camera process the intent did not get a proper uri in my situation. I just upgraded to Android 11 and discovered all these new issues. So I used a file provider for the answer and my 0 byte files became filled with camera data, and of course in the file provider's new location.
I was stuck for a little bit... |
I have same problem |
this a temporary solution, |
Found this on stackoverflow, and it worked for me by directly passing Uri You have to pass the related uri, not the path, Glide.with(context).load(model.photoUri).into(image) By this you don't need to add android:requestLegacyExternalStorage="true" in your Manifest file. |
this issue still exist? |
on Android 10 , Glide failed to load image from local storage.
I have tried gettting WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permission at runtime but still getting same error but works fine devices below Android 10.
I am Assuming its due to Scoped Storage in Android 10.
Scoped Storage
Testing on Essential Ph-1 with Android 10.
The text was updated successfully, but these errors were encountered: