2

In the CommunityToolkit.Maui.Sample app found here under "samples," the folder picker doesn't work on Android as it says it doesn't have permission. I'm trying to check the setting for READ_EXTERNAL_STORAGE in the Required Permissions section of the AndroidManifest.xml, but there are some issues. If I check its box, leave the file, and then come back, it is suddenly unchecked. But in the source code for AndroidManifest.xml, that READ_EXTERNAL_STORAGE is present in code. Also, the title next to the checkbox in Required Permissions reads unlike the other titles. Instead of just saying READ_EXTERNAL_STORAGE it says <span color='red'>READ_EXTERNAL_STORAGE</span>.

I think this one permission will fix the folder picker on Android, but it keeps unchecking the setting. Any idea what's going on here?

an22
  • 53
  • 5
  • If you are having issues with authentication see : https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/communication/authentication?tabs=android For troubleshooting see https://learn.microsoft.com/en-us/dotnet/maui/troubleshooting#platform-version-isnt-present The latest target version may not be present. – jdweng Jul 24 '23 at 23:39

1 Answers1

0

First of all, you can check the source code about the FolderPicker on the android. It used the Permissions.RequestAsync<Permissions.StorageRead>(). But the READ_EXTERNAL_STORAGE permission has been removed since android 13.0. So it will always throw new PermissionException("Storage permission is not granted."); on the android api 33.

I have tested it on the android 12.0 and it worked well. And you can check the known issue about [BUG] READ_EXTERNAL_STORAGE permission on Android 13.

Liyun Zhang - MSFT
  • 8,271
  • 1
  • 2
  • 14