DEV Community

Edafe
Edafe

Posted on • Edited on

Flutter : Your scoped storage permission declaration needs to be updated.

I was publishing an android build using codemagic.io when the process failed with this error.

Scoped storage error

Short Summary on Scoped storage

Of course the first thing i had to do was to research scope storage.

Scope storage is all about the android OS restricting the storage access your app has on the device. In earlier versions of the Android OS, your app has storage access to wide number of locations/folder within the device. This unlimited storage access poses a threat as bad actors can take advantage of it hence the need to restrict it.

The Main Cause

<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
Enter fullscreen mode Exit fullscreen mode

In my case, having the above permission in my AndroidManifest.xml triggered the error

This permission is mostly provided to app such as file explorer.

That does not mean it's a dead end if your app requires this permission. You would just have to update your permission ( Maybe by writing to the playstore review/policy team - ).

But for a lot of app use cases, you wouldn't need this permission.

The above permission is different from these two permission below and they don't trigger the error,

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

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
Enter fullscreen mode Exit fullscreen mode

NOTE : This is only a short note on the above error and you might need to do further research is your use case is different

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay