android - React Native - Play 商店警告 "Starting May 5th you must let us know why your app requires broad storage access"

标签 android react-native google-play asyncstorage

我有一个 React Native 应用程序,它在 Play 商店中有一段时间了,最​​近我收到了来自 Play 商店的重要通知,说明如果我不解决这个问题,我的应用程序将从 Play 商店中删除。
谁能告诉我这是什么以及如何解决它?
这是来自 Play 商店的完整消息

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.


我的 package.json
{
    "@react-native-async-storage/async-storage": "^1.13.4",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/bottom-tabs": "^5.11.8",
    "@react-navigation/drawer": "^5.12.3",
    "@react-navigation/material-bottom-tabs": "^5.3.14",
    "@react-navigation/native": "^5.9.2",
    "@react-navigation/stack": "^5.14.2",
    "axios": "^0.21.1",
    "fuse.js": "^6.4.6",
    "react": "16.13.1",
    "react-native": "0.63.4",
    "react-native-device-info": "^8.0.1",
    "react-native-gesture-handler": "^1.10.0",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-paper": "^4.7.1",
    "react-native-reanimated": "^1.13.2",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.17.1",
    "react-native-svg": "^12.1.0",
    "react-native-vector-icons": "^8.0.0"
}
和 manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.elevel.fromto">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme"
      android:usesCleartextTraffic="true">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>
同样在 Play Console 下 应用程序包浏览器 我发现我的应用正在使用以下权限:
  • android.permission.INTERNET
  • com.google.android.c2dm.permission.RECEIVE
  • com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE
  • 最佳答案

    我发现,如果我们的目标是 Android API 29,我们不必担心警告,只需设置 requestLegacyExternalStorage=true在您应用的 list 文件中。
    虽然我们必须在 11 月之前升级到 Android API 30。

    关于android - React Native - Play 商店警告 "Starting May 5th you must let us know why your app requires broad storage access",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67098530/

    相关文章:

    react-native - 如何将iOS本地URI转换为路径?

    react-native - React 抽屉导航 v5x useNavigation() 与组件类

    android - 如何连接到谷歌播放服务和加载排行榜

    java - 如何使用多个 firebase 项目填充 ListView

    IntelliJ IDEA中Android开发导调用脑死机

    android - Gradle同步失败-无法确定当前字符

    Android:一旦提交并在 Android 或亚马逊市场上生产,是否可以更改 Android 应用程序的描述?

    java - 获取当前位置时尝试调用虚拟方法

    Android map 方向

    android - 如何通过wifi在电脑和智能手机之间进行通信