1

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.

  • Codemagic error : Publishing failed :| Google Play failed to upload artefacts. Your scoped storage permission declaration needs to be updated.: { "error": { "code": 403, "message": "Your scoped storage permission declaration needs to be updated.", "status": "PERMISSION_DENIED" } } – Sercan Kaya Nov 30 '21 at 12:52

2 Answers2

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.

immadisairaj
  • 608
  • 4
  • 11
  • Thanks for the comment, I need to save files in pdf and different formats in the application. I want to write these files to the download folder, how should I go about it. Without using MANAGE_EXTERNAL_STORAGE, sometimes it saves, but not in the simulator. I do the operations with Flutter path_provider. Moreover, in the version I sent for review, MANAGE_EXTERNAL_STORAGE was denied even though I did not want this permission. – Sercan Kaya Dec 06 '21 at 13:33
  • If the review was denied, they might have said why it was denied. You could achieve to save documents to the user storage without `MANAGE_EXTERNAL_STORAGE`. I used `WRITE_EXTERNAL_STORAGE` to store images (didn't use pdfs yet) and the `path_provider` package. I used `${getApplicationDocumentsDirectory().path}/$appName` to store the files. It automatically was saved to Pictures folder (for images). Not sure if that was because of `path_provider` because I used `gallery_saver` to save images to gallery. You could try something similar. I guess not all will go into `Download` folder. – immadisairaj Dec 06 '21 at 15:31
0

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;