targetSdk 29 (scoped storage) support?
See original GitHub issueDescription
Fresco failed to load images from EXTERNAL_CONTENT_URI
e.g. content://media/external/images/media/8039
, FileNotFoundException
was seen from the logs
Reproduction
Loading images with EXTERNAL_CONTENT_URI
content://media/external/images/media/8039
Solution
I found that inside com.facebook.imagepipeline.producers.LocalContentUriFetchProducer
, given the above content uri, it will fall to the call getCameraImage
and which in turn getting the absolute file path of the image. However, due to scoped storage in targetSdk 29, that wouldn’t be allowed. Probably getting input stream like
ParcelFileDescriptor pfd = mContentResolver.openFileDescriptor(contentUri, "r");
FileInputStream fis = FileInputStream(pfd.getFileDescriptor());
Additional Information
- Fresco version: 2.0.0
- Platform version: Android 10
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Behavior changes: apps targeting API 29+ - Android Developers
Scoped storage ; Access to USB device serial number; Ability to enable, disable, and configure Wi-Fi; Location permissions for connectivity APIs. These changes, ......
Read more >Scoped storage / Android 11, targetSdkVersion = 30 / save ...
Is there any way to save → non-media files to /Documents or /Download on targetSdk=30 (without MANAGE_EXTERNAL_STORAGE permission )?.
Read more >Android 10 Behavioral Changes
Apps that run on targetSDK version 29 and later are given scoped access to external storage (or scoped storage), by default. These apps...
Read more >New features and enhancements summary
Support for scoped storage: The Generation 2 wrapper supports scoped storage. ... If the targetSdkVersion of the app is 29 and the app...
Read more >Scope Storage Myths. No, you don't have to use SAF | - Medium
Android 11 is out, more and more devices are being updated. As is tradition, apps will be required to update their targetSdkVersion to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@esafirm I’ve made this PR to show where I got to, if you could test that it works for you that would be great
use this solution as a temporary one