bumptech / glide

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

UnsupportedOperationException: Unknown or unsupported URL content://media/external/audio/media/22282/albumart #5268

Open shiqi12 opened 1 year ago

shiqi12 commented 1 year ago

Glide Version: 4.15.1

Device/Android Version: Android S

Issue details / Repro steps / Use case background: target : 30 android:requestLegacyExternalStorage="true" uri: content://media/external/audio/media/22282/albumart

I use glide 4.10.0 to get bitmap form uri is ok , But when use 4.11.0 or other later version will get UnsupportedOperationException. I find 4.11.0 add QMediaStoreUriLoader.java and will get UnsupportedOperationException. 4.10.0 use StreamLocalUriFetcher to get input tream.

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


Glide.with(ContextHolder.getInstance().getAppContext()).asBitmap().load(Uri.parse(url)).apply(coverRequestOptions).error(defaultImageId).into(createSimpleTarget(targetView, defaultImageId, false));

Stack trace / LogCat:

      07-26 05:19:31.277  3372 15432 E GlideExecutor: java.lang.UnsupportedOperationException: Unknown or unsupported URL: content://media/external/audio/media/22282/albumart
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:174)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at android.content.ContentProviderProxy.query(ContentProviderNative.java:481)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at android.content.ContentResolver.query(ContentResolver.java:1219)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at android.content.ContentResolver.query(ContentResolver.java:1151)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at android.content.ContentResolver.query(ContentResolver.java:1107)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.model.stream.QMediaStoreUriLoader$QMediaStoreUriFetcher.queryForFilePath(QMediaStoreUriLoader.java:200)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.model.stream.QMediaStoreUriLoader$QMediaStoreUriFetcher.buildDelegateData(QMediaStoreUriLoader.java:157)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.model.stream.QMediaStoreUriLoader$QMediaStoreUriFetcher.buildDelegateFetcher(QMediaStoreUriLoader.java:150)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.model.stream.QMediaStoreUriLoader$QMediaStoreUriFetcher.loadData(QMediaStoreUriLoader.java:131)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:95)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:88)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
      07-26 05:19:31.277  3372 15432 E GlideExecutor:     at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:424)