MANAGE_EXTERNAL_STORAGE permission

4,131

If your app targets Android 10 (API level 29) or lower, you can temporarily opt out of scoped storage in your production app. If you target Android 10, however, you need to set the value of requestLegacyExternalStorage to true in your app's manifest file:

<manifest ... >
  <!-- This attribute is "false" by default on apps targeting
       Android 10. -->
  <application android:requestLegacyExternalStorage="true" ... >
    ...
  </application>
</manifest>
Share:
4,131
Nitneuq
Author by

Nitneuq

Updated on December 29, 2022

Comments

  • Nitneuq
    Nitneuq over 1 year

    playstore send me this news

    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.
    

    I don't understand what I need to do...

    I use a plugin to allow user to display picture from his gallery. MANAGE_EXTERNAL_STORAGE permission is display first time user launch the plugin.

    How can I be sure that my app will not be remove the 5th May

    Edit: here is manifest of the only package who need permission for eternet storage, I don't found RequestLegacyExternalStorage

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="io.flutter.plugins.imagepicker">
       <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
       <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    
        <application>
            <provider
                android:name="io.flutter.plugins.imagepicker.ImagePickerFileProvider"
                android:authorities="${applicationId}.flutter.image_provider"
                android:exported="false"
                android:grantUriPermissions="true">
                <meta-data
                    android:name="android.support.FILE_PROVIDER_PATHS"
                    android:resource="@xml/flutter_image_picker_file_paths"/>
            </provider>
        </application>
    </manifest>
    

    thank you

    • ADM
      ADM about 3 years
    • Nitneuq
      Nitneuq about 3 years
      if I understand I onyl need to add <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/> to my manifest ? It's not realy clear for me ( bad english) and I just want to be sure to not have my app remove
    • blackapps
      blackapps about 3 years
      You do not need MANAGE EXTERNAL STORAGE to display pictures from galery.
    • Nitneuq
      Nitneuq about 3 years
      I don"t understand what I really need to do T_T
    • Yegorf
      Yegorf about 3 years
      @blackapps, should i add it if i want to write and read text file (logs)?
    • blackapps
      blackapps about 3 years
      No. Not needed for your own files.
    • Nitneuq
      Nitneuq about 3 years
      @blackapps I need to do nothing without risks to be remove ?
    • Yegorf
      Yegorf about 3 years
      @blackapps, i dont understand it too :D Why it is my own files? (yes, i created it), but how the system will remember it? What if i want to access any text file from the file provider (I can attach some files to the logs) - I need this permission. I have read all documentation, but I'm not sure about it.
    • blackapps
      blackapps about 3 years
      You standard have not access to other apps files on Android 11 unless they are media files. And i have no idea what you mean with: i want to access any text file from the file provider
    • Yegorf
      Yegorf about 3 years
      @blackapps, user downloads file from browser. I want to get this file from Downloads and send it on the backend - that's what i mean.
    • blackapps
      blackapps about 3 years
      The browser is a different app so your app cannot touch the downloaded file.
    • blackapps
      blackapps about 3 years
      Well not in the classic way. But the user can pick the file with ACTION_OPEN_DOCUMENT.
    • Nitneuq
      Nitneuq about 3 years
      I'm still lost on what to do, if someone can help me T_T
  • yozhik
    yozhik almost 3 years
    It's partly true, because if you'll target Api level 30, that requestLegacyExternalStorage will not work anymore and you need to implement solution with SAF or MediaStore
  • Owais Yosuf
    Owais Yosuf about 2 years
    This will work for Android 10 only. What about Android 11.