Starting May 5th, you must let us know why your app requires broad storage access

Google play sent me this message and im wondering how can I achieve this within Unity - im on Unity 2019 LTS

Starting May 5th, you must let us know why your app requires broad storage access

We’ve detected that your app contains the requestLegacyExternalStorage flag in the manifest file of 1 or more of your app bundles or APKs.

Developers with apps on devices running Android 11+ must use Scoped Storage to give users better access control over their device storage. To release your app on Android 11 or newer after May 5th, you must either:

  • Update your app to use more privacy friendly best practices, such as the Storage Access Framework or Media Store API
  • Update your app to declare the All files access (MANAGE_EXTERNAL_STORAGE) permission in the manifest file, and complete the All files access permission declaration in Play Console from May 5th
  • Remove the All files access permission from your app entirely

For apps targeting Android 11, the requestLegacyExternalStorage flag will be ignored. You must use the All files access permission to retain broad access.

Apps requesting access to the All files access permission without a permitted use will be removed from Google Play, and you won’t be able to publish updates.

If you haven’t manually added the flag to your AndroidManifest.xml file, then you have a plugin in your project that adds the flag.

1 Like

This helps me understand what is happening - thank you

I use The Native Gallery open source plugin to save screenshots in my game. After reading your post I went to the update notes and found this:

Added android:requestLegacyExternalStorage=“true” to AndroidManifest to fix the mysterious UnauthorizedAccessException on Android 10

I am guessing the problem has to do with this. I am not sure how to fix this though.

i am going to start by looking on the google play console and seeing if there is a place to declare that I’m using this plugin only for saving screenshots and if that is enough.

But I am wondering how can I test if I meet the new requirements if I choose to edit the code instead. Is srrring this flag to false enough? Do I need to build and submit my game again to find out if this warning is cleared?
Or I notice when I start my game first time it asks me for broad media permission. Maybe if I edit then build and that pop up doesn’t show up it means the game is ok?

I found a thread about the issue with Native Gallery here:

Native Gallery for Android & iOS [Open Source] page-23#post-7041952

I basically says we don’t need the request legacy flag if we are just saving media and instructions on how to remove it from the plugin. I am going to try it and resubmit the game. Thank you for sending me in the right direction

We only just got this warning, so here is what I managed to find out today.

The May 5th deadline is only for apps already targeting API 30 and using All files access permission (MANAGE_EXTERNAL_STORAGE) (A permission introduced in API 30). The reason for showing the warning for people using requestLegacyExternalStorage flag is not clear to me at this point. The consensus seems to be the legacy flag will simply be ignored in API 30+

Here are some interesting links that helped us understand what is happening:
(Reddit discussion) Includes some examples of Google support responses.
(Unity Native Gallery GIT) A good source from a plugin developer that uses the legacy flag to fix issues introduced in API 29.

1 Like