Skip to content
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.storage.request() not working in devices of android 10 in flutter #1408

Open
3 of 5 tasks
Arunachalam-D opened this issue Nov 20, 2024 · 4 comments
Open
3 of 5 tasks
Assignees

Comments

@Arunachalam-D
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

1.Run flutter app on device with android version 10 or below
2Aaccess storage to download files using permission_handler package
3.If initially permission not provided manually open app setting and provide storage permission

Expected results

Should open app setting if permission is not provided and upon giving storage permission files should be downloaded

Actual results

Nothing happens and 'Permission.storage.status' returns 'permission.restricted' even after providing permission from app settings

Code sample

PermissionStatus status = await permission.status;
if (Platform.isAndroid) {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
if (!status.isGranted &&
double.parse(androidInfo.version.release) <= 11) {
...
final result = await Permission.storage.request();
}}

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

^11.0.1

Flutter Doctor output

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.22631.4391], locale en-IN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
X cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2022.1)
[√] VS Code (version 1.95.3)
[√] Connected device (5 available)
[√] Network resources

! Doctor found issues in 2 categories.

@Arunachalam-D Arunachalam-D changed the title Permission.storage.request() not working in devices of android 20 in flutter Permission.storage.request() not working in devices of android 10 in flutter Nov 20, 2024
@sambrucejoseph
Copy link

Yes, happening for me too.
It automatically says permission denied and permission prompt is not popping up.

@TimHoogstrate TimHoogstrate self-assigned this Nov 25, 2024
@Arunachalam-D
Copy link
Author

@sambrucejoseph is the issue fixed or we need to look for other packages?

@l1h2
Copy link

l1h2 commented Dec 6, 2024

I am having the same problem. @sambrucejoseph @Arunachalam-D did you guys manage to solve it, or did you move on to other solutions?

@sambrucejoseph
Copy link

Didn't find any solutions. I actually paused building my feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants