java.lang.IllegalStateException: Failed to find any load path from class java.lang.String to class android.graphics.drawable.Drawable
- Dominant language
- Java
- Stars
- 35k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 8
Description
**Glide Version**: 4.6.1
**Integration libraries**: None.
**Device/Android Version**: HTC U11 (Android 8.0), Galaxy S8 (Android version unknown)
**Issue details / Repro steps / Use case background**:
After my app has been running in the background for a longer time now, Glide fails to load images in a RecyclerView. In logcat, I can see this stacktrace:
```
E/GlideExecutor: Request threw uncaught throwable
java.lang.IllegalStateException: Failed to find any load path from class java.lang.String to class android.graphics.drawable.Drawable
at com.bumptech.glide.load.engine.ResourceCacheGenerator.startNext(ResourceCacheGenerator.java:53)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:299)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:266)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)
```
After some investigation, it seems that `Registry.getRegisteredResourceClasses(String.class, Object.class, Drawable.class)` (as set in the `DecodeHelper`) returns an empty list. This is because `decoderRegistry.getResourceClasses(dataClass, resourceClass)` with `dataClass` from `[InputStream, ParcelFileDescriptor, AssetFileDescriptor]` (as returned by `modelLoaderRegistry.getDataClasses(String.class)` and `resourceClass=Object.class` is always empty.
Unfortunately, I have no clue what any of this means.
**Glide load line / `GlideModule` (if any) / list Adapter code (if any)**:
```kotlin
GlideApp.with(holder.itemView)
.load(postViewModel.post.imageUrl)
.centerCrop()
.transform(MultiTransformation(DarkenTransformation(), RoundedCorners(dimensionPixelSize)))
.transition(DrawableTransitionOptions.withCrossFade())
.into(holder.image)
```
**Layout XML**:
```xml
```
Contributor guide
Assessment
This issue has not been assessed yet.