We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When I select a directory other than Documents and try to save the file I get
Documents
PathAccessException: Cannot open file, path = '/storage/emulated/0/Openreads/Openreads-2025_2_2-16_51_38.backup' (OS Error: Operation not permitted, errno = 1)
Platform
Platform OS version Emulator, Android 15, OnePlus 8T, Android 14
How are you picking?
String? selectedDirectory = await FilePicker.platform.getDirectoryPath(); File('$selectedDirectory/$fileName').writeAsBytesSync( File(tmpBackupPath).readAsBytesSync(), );
Details to reproduce the issue As in the code, open directory picker and try to save the file there.
Error Log
Flutter Version details
flutter doctor -v [✓] Flutter (Channel stable, 3.27.3, on Fedora Linux 41 (Workstation Edition) 6.12.10-200.fc41.x86_64, locale pl_PL.UTF-8) • Flutter version 3.27.3 on channel stable at /home/mateusz/dev/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision c519ee916e (12 dni temu), 2025-01-21 10:32:23 -0800 • Engine revision e672b006cb • Dart version 3.6.1 • DevTools version 2.40.2 [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) • Android SDK at /home/mateusz/Android/Sdk • Platform android-35, build-tools 35.0.1 • Java binary at: /home/mateusz/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java • Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1) • All Android licenses accepted. [✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✓] Linux toolchain - develop for Linux desktop • clang version 19.1.7 (Fedora 19.1.7-1.fc41) • cmake version 3.30.5 • ninja version 1.12.1 • pkg-config version 2.3.0 [✓] Android Studio (version 2024.2) • Android Studio at /home/mateusz/.local/share/JetBrains/Toolbox/apps/android-studio • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • android-studio-dir = /home/mateusz/.local/share/JetBrains/Toolbox/apps/android-studio • Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1) [✓] VS Code (version 1.96.4) • VS Code at /usr/share/code • Flutter extension version 3.102.0 [✓] Connected device (2 available) • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 15 (API 35) (emulator) • Linux (desktop) • linux • linux-x64 • Fedora Linux 41 (Workstation Edition) 6.12.10-200.fc41.x86_64 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 1 category.
Additional context My Manifest:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Also it worked with package shared_storage with below code but it is now discontinued.:
final selectedUriDir = await openDocumentTree(); if (selectedUriDir == null) { return; } createFileAsBytes( selectedUriDir, mimeType: '', displayName: fileName, bytes: File(tmpBackupPath).readAsBytesSync(), );
The text was updated successfully, but these errors were encountered:
I'm facing the same issue. I'm using the flutter_file_dialog package as a work around. When this problem is solved I'll switch to this package.
Sorry, something went wrong.
This issue is stale because it has been open for 7 days with no activity.
No branches or pull requests
Describe the bug
When I select a directory other than
Documents
and try to save the file I getPlatform
Platform OS version
Emulator, Android 15,
OnePlus 8T, Android 14
How are you picking?
Details to reproduce the issue
As in the code, open directory picker and try to save the file there.
Error Log
Flutter Version details
Additional context
My Manifest:
Also it worked with package shared_storage with below code but it is now discontinued.:
The text was updated successfully, but these errors were encountered: