首页 > 解决方案 > MANAGE_EXTERNAL_STORAGE 权限

问题描述

Playstore 向我发送此消息

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.

我不明白我需要做什么...

我使用一个插件来允许用户显示他画廊中的图片。MANAGE_EXTERNAL_STORAGE 权限是在用户首次启动插件时显示。

我如何确定我的应用不会在 5 月 5 日被删除

编辑:这里是唯一需要 eternet 存储权限的包的清单,我没有找到 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>

谢谢你

标签: androidfluttergoogle-play

解决方案


如果您的应用以Android 10(API 级别 29)或更低版本为目标平台,您可以暂时选择退出生产应用中的范围存储。但是,如果您以Android 10为目标,则需要requestLegacyExternalStorage在应用的清单文件中将 的值设置为 true:

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

推荐阅读