-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission Denied even after granting the Storage Permission #31122
Comments
3 days no reply from anyone, Still struggling to get a solution |
@krngd2 Can you share a small, but complete code sample that can be used to try and reproduce? Ideally a repo that includes pubspec with the correct plugin dependencies etc. |
@DanTup Thank you for the response, here is the repo |
Thanks! I tried running this (from VS Code, using current Flutter master channel) on a physical Moto X Play (running Android 7.1.1) and I got this in the Debug Console:
And the storage permission dialog popped up. I approved access, then it wrote:
I guess this is what's supposed to happen, and not what you're seeing? What sort of device are you running on? What version of Android and Flutter are you using? Can you repro on another device (for ex. emulator)? |
Apparently my phone has Google Play services updates and is failing to update, so I'll try again once that finishes. Btw, I noticed in the docs here: https://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE It says that |
I am using a physical device Asus Zenfone Max pro M1 running on Andrpid N. And yes i am using the external storage. Now i changed it to |
I found some comments on SO suggesting it might not work (for ex. https://stackoverflow.com/a/12853922/25124) but I'm not sure why it differed by device. I think moving off it is the best option though, since it seems in Q you won't have an option. I don't think there's anything for Flutter to do here (the permissions are enforced by Android) and since there seems to be a good alternative, I'll close this. Thanks! |
@krngd2 If you are testing in Android Oreo then you need to ask WRITE_EXTERNAL_STORAGE According to "https://developer.android.com/about/versions/oreo/android-8.0-changes.html#rmp"
PermissionPlugin ask only READ_EXTERNAL_STORAGE permission by Permission.requestPermissions([PermissionName**.Storage**]); You can use my repo for asking WRITE_EXTERNAL_STORAGE: |
I am facing the same issue. I have already granted Storage (Read/write) permission. But I can not perform write file operation on flutter( On and above oreo version android devices). |
Please refer my above post, Your problem should be resolved by using my git repo Add this in your pubspec.yaml |
Adding that to pubspec doesn't work. Any other way? |
I'm facing the same issue. How do we access the Downloads folder for devices without External SD Storage option? |
[Possible Solution]: and magically the problem gets solved (I don't know how). Edit: you have to allow Storage permission from the app settings. |
I did the same but still write is failing, Same code is working on other devices. also This was working on my device previously. |
If the problem is on andoid 10 , try making the targetSdk version to 28 in build.gradle file. That worked for me. |
<application add this in the manifest ...it works 100% at least it did for me!!! |
I was having the same issue app perfectly work on below android 10 but not working for above android 10 version devices : ( |
@Abhishek-Chougule see this |
@sanjay23singh is works but I want to build app for Android 10. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
My app works with the files i download over the network. I download and save in a folder called "Bizzappv2". After I implement the run time permission request, its stopped working, throwing permission denied error.
When i manually switch on the storage permission from setting its working good, but when I am requesting the permission on run time its showing permission denied error.
On initState I am requesting for the storage permission using the
permission
pluginflutter run --verbose
flutter analyze
Flutter Doctor
The text was updated successfully, but these errors were encountered: