android - 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>
谢谢你
解决方案
如果您的应用以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>
推荐阅读
- sql - 使用 IMDB 数据集查找使用 Yash Chopra 制作的电影比任何其他导演都多的所有演员(重新发布)
- android - Android Studio 在运行 Flutter 项目时出现问题
- matlab - 使用 Matlab 进行交叉验证和 ROC 曲线:如何绘制平均 ROC 曲线?
- r - 从 R 中的“stop()”调用中修改错误消息
- laravel-5 - 如何减少laravel中的重复代码?
- javascript - 使用 Javascript 替换段落中的单词
- c - Eclipse:如何在没有选择突出显示的情况下复制代码?
- mongodb - 您可以将聚合管道添加到文档 .save() 操作吗?
- php - 在 Laravel 8 中禁用 Auth Register 路由?
- javascript - 将自动完成添加到搜索输入