Repository navigation
Closed as duplicate
Closed as duplicate
Copy link
Labels
P2Important issues not at the top of the work lista: first hourThe first hour of using Fluttera: qualityA truly polished experienceteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team
Description
#69517 Steps to Reproduce
- Create a broken Android Studio client with missing permissions to the Java version.
- Run flutter doctor
You will get the error
null. The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has
read/write permissions for the current user.
This is related to the following line in flutter_tools https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/android/android_studio.dart#L355
The message would be clearer if we instead indicated the specific directory with invalid permissions so a user could fix it /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
Fyi @jonahwilliams
[✓] Flutter (Channel unknown, 1.24.0-8.0.pre.180, on Mac OS X 10.15.7 19H2 darwin-x64,
locale en-US)
• Flutter version 1.24.0-8.0.pre.180 at /Users/jacobr/git/flutter/2/flutter
• Framework revision 84a8bd3f5a (6 hours ago), 2020-11-10 05:21:14 -0800
• Engine revision e50ac2c552
• Dart version 2.12.0 (build 2.12.0-31.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/jacobr/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 48.0.2-dev.6
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 44.0.4-dev.4
• Dart plugin version 193.6015.53
[✓] VS Code (version 1.49.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.16.0
[✓] Connected device (4 available)
• iPhone 8 (mobile) • 5F030C1F-C6D3-4CEF-BCCB-1B8D1D69A5E7 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)
• macOS (desktop) • macos • darwin-x64 • Mac
OS X 10.15.7 19H2 darwin-x64
• Web Server (web) • web-server • web-javascript •
Flutter Tools
• Chrome (web) • chrome • web-javascript •
Google Chrome 86.0.4240.193
• No issues found!
Reacted by Gladson, alexfalcon1, arualana, GibreelAbdullah, Madhav tripathi, Loh Jin Xian, Khurram Malik, Medwin Correo, Antoine Raulin, Rustam Bakytov and 4 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work lista: first hourThe first hour of using Fluttera: qualityA truly polished experienceteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team
Activity
alexfalcon1 commentedon Dec 18, 2020
Please help me I get this error:
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Exception: null. The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
What is the problem?
GreatGodOfFire commentedon Dec 19, 2020
I have the same problem as @alexfalcon1 and I don't know, why it happens because the file that could not be accessed isn't beeing outputed.
(Sorry for my bad English)
GibreelAbdullah commentedon Mar 19, 2021
Any resolution? Workaround?
GibreelAbdullah commentedon Mar 20, 2021
Solved. It was not a bug. It was because I had the project in a separate partition (fat32) for which the current user doesn't have read and write access by default. Giving the permissions to read and write to the default user solved the issue as explained in this post https://askubuntu.com/questions/251206/mount-usb-drive-with-write-permissions-for-everyone-or-specific-user
fairhaven commentedon Sep 13, 2021
"The flutter tool cannot access the file or directory. Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user."
Any help on this while creating a flutter project on window 10?
AdamBridges commentedon Sep 14, 2021
I am also experiencing the same issue after updating to the latest version of Android Studio and Flutter. Permissions worked fine before. I reverted the updates but it's still happening so it must be an issue on my end, I guess.
rajlego commentedon Sep 16, 2021
I'm having the same issue as well on Windows 10
AdamBridges commentedon Sep 16, 2021
I fixed the issue. I was backing up my project files with Google Drive for desktop and the newest version of Drive was locking a particular directory for generating localizations.
To fix it, I had to delete the directory (lib/l10n in my case) and add it again via the IDE (Android Studio). Another solution I discovered was to create a new flutter project and pull your project in from a repo. No repo? Copying and pasting project files into the new project should work but might still involve deleting and re-adding directories within the IDE. Do not use Google Drive for desktop if you want to avoid this.
rajlego commentedon Sep 17, 2021
For me it turns out the issue was windows antivirus. Under Virus & Threat protection you want to make an exclusion for the flutter SDK folder:

DK3369 commentedon Sep 28, 2021
flutter 2.5.1
home /development/flutter
flutter --version
flutter doctor -v
flutter doctor --android-licenses
chmod -R 777 flutter
flutter doctor
chmod -R 777 .config
then,
how and what to do ?
7 remaining items
nirjanmunshi commentedon Sep 12, 2022
In my freshly formatted MacBook Air, I am facing the same issue.
The fact is I haven't created a single project and gettings this strange issue.
GHO5TMEDO commentedon Sep 22, 2022
Thanks a lot it solves the issue on m1 macbook
nirjanmunshi commentedon Sep 23, 2022
I have tried the same thing but didn't work for me. Even if I am running
flutter doctoroutside of the project, I am getting this same issue.arvindkumar749 commentedon Oct 7, 2022
I have the same issue in my Windows 11, I am using my company Laptop so I have not control over Virus & Threat protection if I want to make an exclusion for the flutter SDK folder:
Flutter is in my C drive and we can normally access it on Android Studio for our Mobile Application development. But when I am trying to run the Command (flutter doctor) in Android Studio terminal, it is giving me error Access is denied to that folder in which Flutter is present.
My system is on Windows 11 and it is giving me error and one of my Collogues is using Windows 10 and on which there is no error.
Flutter version - 3.3.4
Android Studio version - version 2021.3
C:\src\flutter>flutter doctor -v
**'git rev-parse HEAD' is not recognized as an internal or external command,
operable program or batch file.
'DIR /B /O:D "C:\src\flutter\packages\flutter_tools\pubspec.yaml" "C:\src\flutter\packages\flutter_tools\pubspec.lock"' is not recognized as an internal or external command,
operable program or batch file.
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.22000.978], locale en-US)
• Flutter version 3.3.4 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision eb6d86e (34 hours ago), 2022-10-04 22:31:45 -0700
• Engine revision c08d7d5efc
• Dart version 2.18.2
• DevTools version 2.15.0
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\arvind.kumar.saharan\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
X Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at
https://github.com/flutter/flutter/issues.
X Exception: null. The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
• #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _throwFileSystemException (package:flutter_tools/src/base/error_handling_io.dart:820:3)
#2 _handleWindowsException (package:flutter_tools/src/base/error_handling_io.dart:810:3)
#3 _run (package:flutter_tools/src/base/error_handling_io.dart:582:7)
#4 AndroidLicenseValidator.licensesAccepted (package:flutter_tools/src/android/android_workflow.dart:394:31)
#5 AndroidLicenseValidator.validate (package:flutter_tools/src/android/android_workflow.dart:321:13)
#6 asyncGuard. (package:flutter_tools/src/base/async_guard.dart:111:24)
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2022 17.3.4)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
• Visual Studio Build Tools 2022 version 17.3.32901.215
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.3)
• Android Studio at C:\Program Files\Android\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
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[√] IntelliJ IDEA Community Edition (version 2022.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2.3
• Flutter plugin version 70.2.5
• Dart plugin version 222.4345.14
[√] VS Code (version 1.71.2)
• VS Code at C:\Users\arvind.kumar.saharan\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.978]
• Chrome (web) • chrome • web-javascript • Google Chrome 106.0.5249.103
• Edge (web) • edge • web-javascript • Microsoft Edge 106.0.1370.34
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.**
C:\src\flutter>
and in normal terminal, flutter doctor android licenses is giving me Access is denied error, below are the logs for the same
C:\src\flutter>flutter doctor --android-licenses
'git rev-parse HEAD' is not recognized as an internal or external command,
operable program or batch file.
'DIR /B /O:D "C:\src\flutter\packages\flutter_tools\pubspec.yaml" "C:\src\flutter\packages\flutter_tools\pubspec.lock"' is not recognized as an internal or external command,
operable program or batch file.
null. The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
C:\src\flutter>
and when I am opening Android Studio on my system, it is giving me below error in Event log: -
Exception: Cannot run program "C:\src\flutter\bin\flutter.bat" (in directory "C:\src\flutter"): CreateProcess error=5, Access is denied
k-suyash commentedon Oct 23, 2022
Having same issue with my MacBook M1. Tried every possible solution! Still failed
avidityindia commentedon Oct 25, 2022
Happening again with 3.3.3 tried doing all the same things!
avidityindia commentedon Oct 26, 2022
Just solved the issue on macOS
Steps as followed:
flutter doctorvolodyahome commentedon Nov 6, 2022
Hi all!
Faced the same problem on mac m1 macos Ventura.
Solution:
Go to the directory: /Users/{username}/Library/Group Containers/group.com.apple.notes/Accounts/E525FE04-C02F-4E84-9EB7-F2F8CF38E443(ID may be different)/Media, find the directory with Android Studio files, delete everything, restart Android Studio and configure. After that the flutter doctor/run/build command does not give an error message:
The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
littletom1 commentedon Jan 17, 2024
hi all,
faced the same problem in win 10
here is my flutter doctor -v
[√] Flutter (Channel stable, 2.10.3, on Microsoft Windows [Version 10.0.19045.3803], locale en-US)
• Flutter version 2.10.3 at D:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7e9793d (1 year, 11 months ago), 2022-03-02 11:23:12 -0600
• Engine revision bd539267b4
• Dart version 2.16.1
• DevTools version 2.9.2
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\Admin\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Common Files\Oracle\Java\javapath\java.exe
• Java version Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201)
X Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know
about this issue at https://github.com/flutter/flutter/issues.
X Exception: null. The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the
current user.
• #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _throwFileSystemException (package:flutter_tools/src/base/error_handling_io.dart:820:3)
#2 _handleWindowsException (package:flutter_tools/src/base/error_handling_io.dart:810:3)
#3 _run (package:flutter_tools/src/base/error_handling_io.dart:582:7)
#4 AndroidLicenseValidator.licensesAccepted (package:flutter_tools/src/android/android_workflow.dart:388:31)
#5 AndroidLicenseValidator.validate (package:flutter_tools/src/android/android_workflow.dart:315:13)
#6 asyncGuard. (package:flutter_tools/src/base/async_guard.dart:111:24)
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[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 2023.1)
• Android Studio at C:\Program Files\Android\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
X Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[√] VS Code, 64-bit edition (version 1.84.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.3803]
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.224
• Edge (web) • edge • web-javascript • Microsoft Edge 120.0.2210.133
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 3 categories.
I haved tried:
I still got The flutter tool cannot access the file or directory.
anyone has solutions?
many thanks
github-actions commentedon Jul 24, 2025
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
flutter doctor -vand a minimal reproduction of the issue.