ivehement / saf

Flutter plugin that leverages Storage Access Framework (SAF) API to get access and perform the operations on files and folders.
https://pub.dev/packages/saf
MIT License
17 stars 17 forks source link

Exception - Permission Denial #10

Closed AliAlHourash closed 2 years ago

AliAlHourash commented 2 years ago

This exception appear when I try to open media directory

_Permission Denial: reading com.android.externalstorage.ExternalStorageProvider uri content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses/document/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses/children from pid=32755, uid=10159 requires that you obtain access using ACTION_OPENDOCUMENT or related APIs

Stephen-Cronin commented 1 year ago

@AliAlHourash - Out of interest, why did you close this? Did you solve the problem? I'm having the same thing.

milesegan commented 8 months ago

I'm also getting this error if I try to open the root directory like this:

final _saf = Saf("");

If I give it a more specific subpath then it seems to work:

final _saf = Saf("Music");
milesegan commented 8 months ago

It also works if I use an empty initial directory but pass isDynamic: true:

final _saf = Saf("");
final isGranted = await _saf.getDirectoryPermission(isDynamic: true);