bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.62k stars 6.12k forks source link

Error loading resources #2265

Closed matthieuchemin closed 7 years ago

matthieuchemin commented 7 years ago

Glide Version: 4.0.0

Integration libraries:

Device/Android Version: Emulator Pixel / API 25

Issue details / Repro steps / Use case background: I have trouble loading resources to an image view using the load method. I have test with several different resources. I observed that this error only occurred when firstResId (the id of the drawable i use to call load) is the id of an xml drawable. However this kind of drawable are handle fine by the placeholder method.

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


mGlideRequestManager  = Glide.with(DealThreadsFragmentBase.this)
...
mGlideRequestManager
                        .load(firstResId) //id of a drawable
                        .apply(mRequestOptions
                                .placeholder(secondeResId) //id of a drawable
                        )
                        .into(viewHolder.threadImageView);

Layout XML:

        <ImageView
            android:id="@+id/post_deal_thread_image"
            android:layout_width="96dp"
            android:layout_height="96dp"
            android:layout_marginLeft="@dimen/deal_thread_image_margin_left"
            android:layout_marginStart="@dimen/deal_thread_image_margin_left"
            android:scaleType="centerCrop"
            tools:src="@drawable/placeholder_deal_96dp" />

Stack trace / LogCat:

I/Glide: Root cause (1 of 1)
 java.io.FileNotFoundException: Resource does not exist: 
  android.resource://com.pepper.apps.android.beta4.debug/drawable/smiley_devil_height_24dp

at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:976)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:907)
at com.bumptech.glide.load.data.FileDescriptorLocalUriFetcher.loadResource(FileDescriptorLocalUriFetcher.java:21)
at com.bumptech.glide.load.data.FileDescriptorLocalUriFetcher.loadResource(FileDescriptorLocalUriFetcher.java:13)
at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:40)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:95)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:61)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:282)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:398)
at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:359)
at com.bumptech.glide.load.engine.SourceGenerator.onDataReady(SourceGenerator.java:111)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onDataReady(MultiModelLoader.java:129)
at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:48)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:95)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:61)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:282)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:252)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:222)
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:761)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:347)
sjudd commented 7 years ago

Duplicate of #2137

avnitambaliya31 commented 2 years ago

I fetched the same issue with this. so, how to fix this crash error. any one please suggest me .

avnitambaliya31 commented 2 years ago

): Load failed for content://media/external/images/media/46462 with size [192x192] W/Glide (27596): class com.bumptech.glide.load.engine.GlideException: Failed to load resource W/Glide (27596): There were 5 causes: 5 W/Glide (27596): java.io.FileNotFoundException(open failed: ENOENT (No such file or directory)) W/Glide (27596): call GlideException#logRootCauses(String) for more detail W/Glide (27596): Cause (1 of 6): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, LOCAL

W/Glide (27596): There was 1 cause: W/Glide (27596): java.io.FileNotFoundException(open failed: ENOENT (No such file or directory)) W/Glide (27596): call GlideException#logRootCauses(String) for more detail W/Glide (27596): Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed W/Glide (27596): There was 1 cause: W/Glide (27596): java.io.FileNotFoundException(open failed: ENOENT (No such file or directory)) W/Glide (27596): call GlideException#logRootCauses(String) for more detail W/Glide (27596): Cause (1 of 1): class java.io.FileNotFoundException: open failed: ENOENT (No such file or directory) W/Glide (27596): Cause (2 of 6): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class android.os.ParcelFileDescriptor, LOCAL W/Glide (27596): There was 1 cause: W/Glide (27596): java.io.FileNotFoundException(open failed: ENOENT (No such file or directory)) W/Glide (27596): call GlideException#logRootCauses(String) for more detail W/Glide (27596): Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed W/Glide (27596): There was 1 cause: W/Glide (27596): java.io.FileNotFoundException(open failed: ENOENT (No such file or directory)) W/Glide (27596): call GlideException#logRootCauses(String) for more detail W/Glide (27596): Cause (1 of 1): class java.io.FileNotFoundException: open failed: ENOENT (No such file or directory) W/Glide (27596): Cause (3 of 6): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, LOCAL W/Glide (27596): There was 1 cause: W/Glide (27596): java.io.FileNotFoundException(open failed: ENOENT (No such file or directory)) W/Glide (27596): call GlideException#logRootCauses(String) for more detail W/Glide (27596): Cause (1 of 1): class java.io.FileNotFoundException: open failed: ENOENT (No such file or directory) W/Glide (27596): Cause (4 of 6): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class android.os.ParcelFileDescriptor, LOCAL W/Glide (27596): There was 1 cause: W/Glide (27596): java.io.FileNotFoundException(open failed: ENOENT (No such file or directory)) W/Glide (27596): call GlideException#logRootCauses(String) for more detail W/Glide (27596): Cause (1 of 1): class java.io.FileNotFoundException: open failed: ENOENT (No such file or directory) W/Glide (27596): Cause (5 of 6): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class android.content.res.AssetFileDescriptor, LOCAL .

W/Glide (27596): There was 1 cause: W/Glide (27596): java.io.FileNotFoundException(open failed: ENOENT (No such file or directory)) W/Glide (27596): call GlideException#logRootCauses(String) for more detail W/Glide (27596): Cause (1 of 1): class java.io.FileNotFoundException: open failed: ENOENT (No such file or directory) W/Glide (27596): Cause (6 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{StringUri->Object->Drawable}, LOCAL W/Glide (27596): Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{StringUri->Drawable->Drawable} W/Glide (27596): Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{StringUri->Bitmap->Drawable} I/Glide (27596): Root cause (1 of 5) I/Glide (27596): java.io.FileNotFoundException: open failed: ENOENT (No such file or directory) I/Glide (27596): at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151) I/Glide (27596): at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:781) I/Glide (27596): at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:2008) I/Glide (27596): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1823) I/Glide (27596): at android.content.ContentResolver.openInputStream(ContentResolver.java:1500) I/Glide (27596): at com.bumptech.glide.load.data.StreamLocalUriFetcher.loadResourceFromUri(StreamLocalUriFetcher.java:74) I/Glide (27596): at com.bumptech.glide.load.data.StreamLocalUriFetcher.loadResource(StreamLocalUriFetcher.java:50) I/Glide (27596): at com.bumptech.glide.load.data.StreamLocalUriFetcher.loadResource(StreamLocalUriFetcher.java:13) I/Glide (27596): at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:44) I/Glide (27596): at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100) I/Glide (27596): at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.startNextOrFail(MultiModelLoader.java:164) I/Glide (27596): at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onDataReady(MultiModelLoader.java:147) I/Glide (27596): at com.bumptech.glide.load.data.mediastore.ThumbFetcher.loadData(ThumbFetcher.java:70) I/Glide (27596): at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100) I/Glide (27596): at com.bumptech.glide.load.model.stream.QMediaStoreUriLoader$QMediaStoreUriFetcher.loadData(QMediaStoreUriLoader.java:141) I/Glide (27596): at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70) I/Glide (27596): at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63) I/Glide (27596): at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310) I/Glide (27596): at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:434) I/Glide (27596): at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:390) I/Glide (27596): at com.bumptech.glide.load.engine.SourceGenerator.onDataReadyInternal(SourceGenerator.java:148) I/Glide (27596): at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady(SourceGenerator.java:76) I/Glide (27596): at com.bumptech.glide.load.data.mediastore.ThumbFetcher.loadData(ThumbFetcher.java:70) I/Glide (27596): at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70) I/Glide (27596): at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63) I/Glide (27596): at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310) I/Glide (27596): at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:279)