Glide Version: 4.0.0-RC1
Integration libraries: okhttp3-4.0.0-RC1
Device/Android Version: Nexus 5X 7.1.2
Issue details / Repro steps / Use case background:
Loading an Uri pointing to a resource drawable "android.resource://package/drawable/ic_facebook" fails if the drawable is a Vector. Works fine otherwise, so that is definitely the problem.
Stack trace / LogCat:
07-13 13:35:47.132 23478-23478/package W/Glide: Load failed for android.resource://package/drawable/ic_facebook with size [189x189]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{AssetInputStream->Bitmap->Bitmap}, LOCAL
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{AssetInputStream->Bitmap->Bitmap}
Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class android.os.ParcelFileDescriptor, LOCAL
Cause (1 of 1): class java.io.FileNotFoundException: Resource does not exist: android.resource://package/drawable/ic_facebook
07-13 13:35:47.132 23478-23478/package E/Glide: class com.bumptech.glide.load.engine.GlideException: Failed to load resource
07-13 13:35:47.134 23478-23478/package I/Glide: Root cause (1 of 1)
java.io.FileNotFoundException: Resource does not exist: android.resource://package/drawable/ic_facebook
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.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.data.LocalUriFetcher.loadData(LocalUriFetcher.java:48)
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)
Getting this error too on an emulator for Pixel XL. Any update on this guys?
Is a shape a vector?
Because I got same error when I load an xml drawable (a shape). I own the drawable (not from another library)
I'm seeing an error similar to this as well, except it is happening for Android Oreo's adaptive icons (defined similarly to vectors and shapes in an xml):
Root cause (1 of 1)
java.io.FileNotFoundException: Resource does not exist: android.resource://com.android.chrome/2130837809
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1239)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1170)
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: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:347)
Normal icons seem to be working as expected (tested with Uber, which does not support an adaptive icon yet).
It looks like the issue is that load just doesn't like VectorDrawables. Looking at https://github.com/bumptech/glide/issues/1532, it turns out just doing
GlideApp.with(context).load(null).fallback(R.drawable.my_vector).into(imageView)
will work fine. Yes, it has to be GlideApp, which means you need to implement a GlideAppModule, which is pretty simple. You can do that by creating a file with these contents:
@GlideModule
public final class MyAppGlideModule extends AppGlideModule {}
For more information about the GlideAppModule and the generated API, check http://bumptech.github.io/glide/doc/generatedapi.html
Actually this is a duplicate of #350.
Most helpful comment
Getting this error too on an emulator for Pixel XL. Any update on this guys?