android - MANAGE_EXTERNAL_STORAGE 权限

标签 android flutter google-play

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 存储权限的包的 list ,我没有找到 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>

谢谢

最佳答案

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

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

关于android - MANAGE_EXTERNAL_STORAGE 权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67107041/

相关文章:

启动构建 iOS 时崩溃

android - 在安装我的应用程序期间,我如何要求用户安装另一个 Android 应用程序(我的应用程序依赖于该应用程序)?

java - 使用 Android 实现 Bouncy CaSTLe 密码算法

android - EntityUtils.toString() 会导致 NetworkOnMainThreadException 吗?

Android:如何将我的应用程序标记为可调试?

android - 使用google_maps_autocomplete后Flutter无法运行

flutter TabBarView 不会通过 TabController 通过点击选项卡/选项卡而改变,滑动时不会改变,但 tabbarview 会

android - Google Play服务和 “Duplicate Provider Authority”

android - 我的 Android 应用不适用于 Google Play 上的平板电脑

android - 安装先决条件应用程序以在 firebase 测试实验室中测试我们的应用程序