Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: We've detected that your app contains the requestLegacyExternalStorage flag in the manifest file of 1 or more of your app bundles or APKs

I have an app on Google play store that uses the Flutter image_picker. I have received an alert from Google which says that I cannot use requestLegacyExternalStorage =true in my manifest file. I am confused and don't know what to do because in the documentation of image_picker it clearly says that we should use requestLegacyExternalStorage in the manifest file. Please help me solve this problem and is there a workaround for this?

enter image description here

like image 473
Junaid Hassan Final Avatar asked Nov 07 '22 02:11

Junaid Hassan Final


1 Answers

If your targetSdk is not 30 you can keep using the flag android:requestLegacyExternalStorage="true" and you don't have to do anything.

From this post:

Google Play restricts the use of high risk or sensitive permissions, including a special app access called All files access. This is only applicable to apps that target Android 11 (API level 30) and declare the MANAGE_EXTERNAL_STORAGE permission, which is added in Android 11. Also, this policy does not impact the usage of the READ_EXTERNAL_STORAGE permission.

If your app does not require access to the MANAGE_EXTERNAL_STORAGE permission, you must remove it from your app's manifest in order to successfully publish your app. Details on policy-compliant alternative implementations are also detailed below.

If your app meets the policy requirements for acceptable use or is eligible for an exception, you will be required to declare this and any other high risk permissions using the Declaration Form in Play Console.

Apps that fail to meet policy requirements or do not submit a Declaration Form may be removed from Google Play.

Also, this GitHub post have a good discussion about this:

SDK 41 contains all the necessary changes to make your app compatible with Android 11, and should not result in removal from the Play Store. There is no action for you to take. Just because you received this warning, does not mean your app is infringing on the new scoped storage policy. According to this response from someone at Google, they sent this warning to anyone using the requestLegacyExternalStorage flag since it is their best indicator of apps that may need to declare the MANAGE_EXTERNAL_STORAGE permission.

  • If you're on SDK 41- you have nothing to do, you can ignore this warning.
  • If you're on SDK 40 or below- you can ignore this warning since it's specific to targeting Android 11.

Check out also this useful links:

  • https://developer.android.com/about/versions/11/privacy/storage
  • https://www.androidcentral.com/what-scoped-storage
like image 153
MαπμQμαπkγVπ.0 Avatar answered Nov 15 '22 07:11

MαπμQμαπkγVπ.0