【问题标题】:MANAGE_EXTERNAL_STORAGE permissionMANAGE_EXTERNAL_STORAGE 权限
【发布时间】:2021-07-10 09:45:17
【问题描述】:

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>

谢谢

【问题讨论】:

  • 如果我理解我只需要添加 到我的清单?这对我来说不是很清楚(英语不好),我只是想确保我的应用不会被删除
  • 您不需要管理外部存储来显示画廊中的图片。
  • 我不明白我真正需要做什么T_T
  • 没有。您自己的文件不需要。

标签: android flutter google-play


【解决方案1】:

如果您的应用面向 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>

【讨论】:

  • 部分正确,因为如果您的目标是 Api 级别 30,那么 requestLegacyExternalStorage 将不再工作,您需要使用 SAF 或 MediaStore 实施解决方案
  • 这仅适用于 Android 10。 Android 11 怎么样。
猜你喜欢
  • 1970-01-01
  • 2021-01-22
  • 2021-12-29
  • 2022-01-18
  • 2022-01-05
  • 1970-01-01
  • 1970-01-01
  • 2022-10-03
  • 2023-01-21
相关资源
最近更新 更多