'Your scoped storage permission declaration needs to be updated

My Android Manifest

        <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
   <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.ACTION_MANAGE_STORAGE"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
   <application
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
           android:requestLegacyExternalStorage="true"
           android:hasFragileUserData = "true"
        android:usesCleartextTraffic="true">

My Build Gradle

android {
compileSdkVersion 31

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
    checkReleaseBuilds false
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    minSdkVersion 21
    targetSdkVersion 31
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    multiDexEnabled true
}

I am getting an error while installing the app on google play. I think I couldn't find a solution because I came across very mixed answers when I searched for a situation related to google new policies.



Solution 1:[1]

Google has updated the storage permissions and policy from Android 11. I suggest you to go through the Policy once. link.

The above link had this line

Files and directory attributes on a user’s device are regarded as personal and sensitive user data subject to the Personal and Sensitive Information policy and the following requirements: I suggest you to go through that.

It is better to use the scoped storage Android is providing from Android 11 (unless mandatory requirement is there).

Read about Scoped Storage from: link1, link2

Reference link on how to use the storages.

I suggest you to minimize the use of MANAGE_EXTERNAL_STORAGE as much as possible in favour of Google Policies.

If the requirement is there and you want to publish that way. You need to submit them why you are using the permission which they will review and publish/revert back the issue. Below is the process you can follow.

After uploading your Android App Bundle from Google Play Console (web page). You will be getting an error where you can find a link to an application form "All Files Access". Where you can submit it.

or follow this link for the process. Understand the use of All Files Access here.

Solution 2:[2]

add this to your Manifest

 <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />

and ask for this permission

await Permission.manageExternalStorage.request().isGranted;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 immadisairaj
Solution 2 Leen Alhamdan