Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
ComeOnAndSam's avatar
ComeOnAndSam
Explorer
4 years ago

Permission denied on accessing storage even though I gave it

I'm trying to call Directory.EnumerateFiles on "storage/emulated/0/Android".

 

In unity I called

if (!Permission.HasUserAuthorizedPermission(Permission.ExternalStorageRead))
{
   Permission.RequestUserPermission(Permission.ExternalStorageRead);
}

And then the permissions window appeared and I hit allow.

 

Yet when I call EnumerateFiles, I'm told "IOException: Permission Denied"