bug: READ_EXTERNAL_STORAGE Deprecated: File Access Fails on Android 13+ in Capacitor Ionic App #351
Open
5 of 28 tasks
Labels
bug/fix
Something isn't working
needs: reply
needs: reproduction
needs: triage
package: file-picker
platform: android
Android platform
Plugin(s)
Version
6.0.1
Platform(s)
Current behavior
As stated in the plugin documentation, to pick a file from external storage, the following permission is required:
However, READ_EXTERNAL_STORAGE is deprecated and not granted when targeting Android 13+. If you need to query or interact with MediaStore or media files on shared storage, you should use one or more of the new storage permissions instead:
Scoped storage is enforced on Android 10+ (or Android 11+ if requestLegacyExternalStorage is used). Specifically, WRITE_EXTERNAL_STORAGE no longer provides write access to all files but instead provides functionality equivalent to READ_EXTERNAL_STORAGE.
Expected behavior
Apps are restricted to accessing only the media files (e.g., images, videos, or audio) that the user explicitly allows through the newly introduced permissions:
READ_MEDIA_IMAGES: Grants read access only to image files in the shared storage.
READ_MEDIA_VIDEO: Grants read access only to video files in the shared storage.
READ_MEDIA_AUDIO: Grants read access only to audio files in the shared storage.
Reproduction
https://capawesome.io/plugins/file-picker/
Steps to reproduce
Other information
No response
Capacitor doctor
[warn] The bundledWebRuntime configuration option has been deprecated. Can be safely deleted.
Capacitor Doctor
Latest Dependencies:
@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2
[success] Android looking great! 👌
Before submitting
The text was updated successfully, but these errors were encountered: