question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] READ_EXTERNAL_STORAGE permission on Android 13

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the “Reporting a bug” section on Contributing file?

Current Behavior

The newly added feature FolderPicker is not working properly on Android 13. As of Android 13 (Api 33), it is no longer possible to use READ_EXTERNAL_STORAGE. The new permissions are:

  • Images and photos: READ_MEDIA_IMAGES
  • Videos: READ_MEDIA_VIDEO
  • Audio files: READ_MEDIA_AUDIO

As can be seen here Android 13 Behavior Changes,

Expected Behavior

We could just probably check if API is smaller than API 33 and then use READ_EXTERNAL_STORAGE otherwise request READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO, or from my testing we don’t need to request permission at all since if we want to request folder to which we don’t we have permission this permission will be automatically requested via folder picker.

Steps To Reproduce

Try to run the FilePicker on a device with Android 13 (API 33).

Link to public reproduction project repository

We can just use Sample from https://github.com/CommunityToolkit/Maui/tree/main/samples/CommunityToolkit.Maui.Sample itself.

Environment

- .NET MAUI CommunityToolkit: 4.0.0
- OS: Windows 10 Enterprise Build 19044.2486
- .NET MAUI: 7.0.59 Service Release 3

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
MichaelStettcommented, May 29, 2023

Thank you for this workaround! @zZHorizonZz 😃

1reaction
VladislavAntonyukcommented, May 2, 2023

@zZHorizonZz it is not an issue of CommunityToolkit. It’s better to open the issue in .NET MAUI repo on Permissions.RequestAsync API

Read more comments on GitHub >

github_iconTop Results From Across the Web

READ_EXTERNAL_STORAGE_...
If your app targets Android 13, you must request one or more new permissions instead of the READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE ...
Read more >
Behavior changes: Apps targeting Android 13 or higher
If your app targets Android 13 and requires access to body sensor information while running in the background, you must declare the new...
Read more >
[Bug] Storage permissions Android 13 api 33 · Issue #2041
We are facing this issue in our file downloader. Up to Android 12 we could simply asked the user for permission to download...
Read more >
How should your app be updated for Android 13 given the ...
Three new permission is introduced with Android 13: READ_MEDIA_IMAGES , READ_MEDIA_IMAGES , READ_MEDIA_VIDEO , and READ_MEDIA_AUDIO .Use one of ...
Read more >
Manage Write External Storage Permission android 13
No more android. permission.write_external_storage android 13, ... permission with separate methodology and READ_EXTERNAL_STORAGE is no more ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found