Skip to content

Confusing error message from flutter tools when verifying a broken Android Studio version. #70216

Closed as duplicate

Description

@jacob314

#69517 Steps to Reproduce

  1. Create a broken Android Studio client with missing permissions to the Java version.
  2. 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!

Activity

  1. added
    a: quality
    P2
    tool
    on Nov 10, 2020
  2. alexfalcon1 commented on Dec 18, 2020

    @alexfalcon1

    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?

  3. GreatGodOfFire commented on Dec 19, 2020

    @GreatGodOfFire

    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)

  4. GibreelAbdullah commented on Mar 19, 2021

    @GibreelAbdullah

    Any resolution? Workaround?

  5. GibreelAbdullah commented on Mar 20, 2021

    @GibreelAbdullah

    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

  6. added
    a: first hour
    on May 6, 2021
  7. fairhaven commented on Sep 13, 2021

    @fairhaven

    "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?

  8. AdamBridges commented on Sep 14, 2021

    @AdamBridges

    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.

  9. rajlego commented on Sep 16, 2021

    @rajlego

    I'm having the same issue as well on Windows 10

  10. AdamBridges commented on Sep 16, 2021

    @AdamBridges

    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.

  11. rajlego commented on Sep 17, 2021

    @rajlego

    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:
    image

  12. DK3369 commented on Sep 28, 2021

    @DK3369

    flutter 2.5.1
    home /development/flutter

    flutter --version

    Flutter 2.5.1 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision ffb2ecea52 (11 days ago) • 2021-09-17 15:26:33 -0400
    Engine • revision b3af521a05
    Tools • Dart 2.14.2
    

    flutter doctor -v

    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:813:3)
    #2      _handlePosixException
    (package:flutter_tools/src/base/error_handling_io.dart:761:3)
    #3      _runSync (package:flutter_tools/src/base/error_handling_io.dart:614:7)
    #4      ErrorHandlingProcessManager.runSync
    (package:flutter_tools/src/base/error_handling_io.dart:711:12)
    #5      _DefaultProcessUtils.runSync
    (package:flutter_tools/src/base/process.dart:373:51)
    #6      AndroidStudio._init
    (package:flutter_tools/src/android/android_studio.dart:462:39)
    #7      new AndroidStudio
    (package:flutter_tools/src/android/android_studio.dart:40:5)
    #8      new AndroidStudio.fromMacOSBundle
    (package:flutter_tools/src/android/android_studio.dart:94:12)
    #9      AndroidStudio._allMacOS.<anonymous closure>
    (package:flutter_tools/src/android/android_studio.dart:320:67)
    #10     MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
    #11     ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
    #12     WhereTypeIterator.moveNext (dart:_internal/iterable.dart:869:20)
    #13     new _GrowableList._ofOther (dart:core-patch/growable_array.dart:198:26)
    #14     new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
    #15     new List.of (dart:core-patch/array_patch.dart:50:28)
    #16     Iterable.toList (dart:core/iterable.dart:388:12)
    #17     AndroidStudio._allMacOS
    (package:flutter_tools/src/android/android_studio.dart:322:10)
    #18     AndroidStudio.allInstalled
    (package:flutter_tools/src/android/android_studio.dart:251:34)
    #19     AndroidStudio.latestValid
    (package:flutter_tools/src/android/android_studio.dart:236:41)
    #20     AppContext._generateIfNecessary.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:104:42)
    #21     _LinkedHashMapMixin.putIfAbsent
    (dart:collection-patch/compact_hash.dart:314:23)
    #22     AppContext._generateIfNecessary
    (package:flutter_tools/src/base/context.dart:92:20)
    #23     AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
    #24     AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
    #25     AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
    #26     androidStudio
    (package:flutter_tools/src/globals_null_migrated.dart:54:45)
    #27     runInContext.<anonymous closure>
    (package:flutter_tools/src/context_runner.dart:104:32)
    #28     AppContext._generateIfNecessary.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:104:42)
    #29     _LinkedHashMapMixin.putIfAbsent
    (dart:collection-patch/compact_hash.dart:314:23)
    #30     AppContext._generateIfNecessary
    (package:flutter_tools/src/base/context.dart:92:20)
    #31     AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
    #32     AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
    #33     AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
    #34     androidLicenseValidator
    (package:flutter_tools/src/android/android_workflow.dart:28:65)
    #35     DoctorCommand.runCommand
    (package:flutter_tools/src/commands/doctor.dart:53:32)
    #36     FlutterCommand.verifyThenRunCommand
    (package:flutter_tools/src/runner/flutter_command.dart:1274:12)
    <asynchronous suspension>
    #37     FlutterCommand.run.<anonymous closure>
    (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
    <asynchronous suspension>
    #38     AppContext.run.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:150:19)
    <asynchronous suspension>
    #39     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
    <asynchronous suspension>
    #40     FlutterCommandRunner.runCommand.<anonymous closure>
    (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
    <asynchronous suspension>
    #41     AppContext.run.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:150:19)
    <asynchronous suspension>
    #42     FlutterCommandRunner.runCommand
    (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
    <asynchronous suspension>
    #43     run.<anonymous closure>.<anonymous closure>
    (package:flutter_tools/runner.dart:62:9)
    <asynchronous suspension>
    #44     AppContext.run.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:150:19)
    <asynchronous suspension>
    #45     main (package:flutter_tools/executable.dart:92:3)
    <asynchronous suspension>
    

    flutter doctor --android-licenses

    
    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.
    

    chmod -R 777 flutter
    flutter doctor

    
    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.
    

    chmod -R 777 .config

    
    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.
    

    then,
    how and what to do ?

  13. 7 remaining items

  14. nirjanmunshi commented on Sep 12, 2022

    @nirjanmunshi

    In my freshly formatted MacBook Air, I am facing the same issue.

    Nirjan@Administrators-MacBook-Air ~ % flutter doctor -v
    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.
    

    The fact is I haven't created a single project and gettings this strange issue.

  15. GHO5TMEDO commented on Sep 22, 2022

    @GHO5TMEDO

    After spending hours, finally I can solve this issue by removing extended attribute with :

    $ sudo xattr -c -r <project_folder>
    

    https://stackoverflow.com/a/69792692/3733730

    Thanks a lot it solves the issue on m1 macbook

  16. nirjanmunshi commented on Sep 23, 2022

    @nirjanmunshi

    After spending hours, finally I can solve this issue by removing extended attribute with :

    $ sudo xattr -c -r <project_folder>
    

    https://stackoverflow.com/a/69792692/3733730

    Thanks a lot it solves the issue on m1 MacBook

    I have tried the same thing but didn't work for me. Even if I am running flutter doctor outside of the project, I am getting this same issue.

  17. arvindkumar749 commented on Oct 7, 2022

    @arvindkumar749

    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

  18. k-suyash commented on Oct 23, 2022

    @k-suyash

    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

    Having same issue with my MacBook M1. Tried every possible solution! Still failed

  19. avidityindia commented on Oct 25, 2022

    @avidityindia

    flutter 2.5.1 home /development/flutter

    flutter --version

    Flutter 2.5.1 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision ffb2ecea52 (11 days ago) • 2021-09-17 15:26:33 -0400
    Engine • revision b3af521a05
    Tools • Dart 2.14.2
    

    flutter doctor -v

    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:813:3)
    #2      _handlePosixException
    (package:flutter_tools/src/base/error_handling_io.dart:761:3)
    #3      _runSync (package:flutter_tools/src/base/error_handling_io.dart:614:7)
    #4      ErrorHandlingProcessManager.runSync
    (package:flutter_tools/src/base/error_handling_io.dart:711:12)
    #5      _DefaultProcessUtils.runSync
    (package:flutter_tools/src/base/process.dart:373:51)
    #6      AndroidStudio._init
    (package:flutter_tools/src/android/android_studio.dart:462:39)
    #7      new AndroidStudio
    (package:flutter_tools/src/android/android_studio.dart:40:5)
    #8      new AndroidStudio.fromMacOSBundle
    (package:flutter_tools/src/android/android_studio.dart:94:12)
    #9      AndroidStudio._allMacOS.<anonymous closure>
    (package:flutter_tools/src/android/android_studio.dart:320:67)
    #10     MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
    #11     ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
    #12     WhereTypeIterator.moveNext (dart:_internal/iterable.dart:869:20)
    #13     new _GrowableList._ofOther (dart:core-patch/growable_array.dart:198:26)
    #14     new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
    #15     new List.of (dart:core-patch/array_patch.dart:50:28)
    #16     Iterable.toList (dart:core/iterable.dart:388:12)
    #17     AndroidStudio._allMacOS
    (package:flutter_tools/src/android/android_studio.dart:322:10)
    #18     AndroidStudio.allInstalled
    (package:flutter_tools/src/android/android_studio.dart:251:34)
    #19     AndroidStudio.latestValid
    (package:flutter_tools/src/android/android_studio.dart:236:41)
    #20     AppContext._generateIfNecessary.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:104:42)
    #21     _LinkedHashMapMixin.putIfAbsent
    (dart:collection-patch/compact_hash.dart:314:23)
    #22     AppContext._generateIfNecessary
    (package:flutter_tools/src/base/context.dart:92:20)
    #23     AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
    #24     AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
    #25     AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
    #26     androidStudio
    (package:flutter_tools/src/globals_null_migrated.dart:54:45)
    #27     runInContext.<anonymous closure>
    (package:flutter_tools/src/context_runner.dart:104:32)
    #28     AppContext._generateIfNecessary.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:104:42)
    #29     _LinkedHashMapMixin.putIfAbsent
    (dart:collection-patch/compact_hash.dart:314:23)
    #30     AppContext._generateIfNecessary
    (package:flutter_tools/src/base/context.dart:92:20)
    #31     AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
    #32     AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
    #33     AppContext.get (package:flutter_tools/src/base/context.dart:119:24)
    #34     androidLicenseValidator
    (package:flutter_tools/src/android/android_workflow.dart:28:65)
    #35     DoctorCommand.runCommand
    (package:flutter_tools/src/commands/doctor.dart:53:32)
    #36     FlutterCommand.verifyThenRunCommand
    (package:flutter_tools/src/runner/flutter_command.dart:1274:12)
    <asynchronous suspension>
    #37     FlutterCommand.run.<anonymous closure>
    (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
    <asynchronous suspension>
    #38     AppContext.run.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:150:19)
    <asynchronous suspension>
    #39     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
    <asynchronous suspension>
    #40     FlutterCommandRunner.runCommand.<anonymous closure>
    (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
    <asynchronous suspension>
    #41     AppContext.run.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:150:19)
    <asynchronous suspension>
    #42     FlutterCommandRunner.runCommand
    (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
    <asynchronous suspension>
    #43     run.<anonymous closure>.<anonymous closure>
    (package:flutter_tools/runner.dart:62:9)
    <asynchronous suspension>
    #44     AppContext.run.<anonymous closure>
    (package:flutter_tools/src/base/context.dart:150:19)
    <asynchronous suspension>
    #45     main (package:flutter_tools/executable.dart:92:3)
    <asynchronous suspension>
    

    flutter doctor --android-licenses

    
    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.
    

    chmod -R 777 flutter flutter doctor

    
    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.
    

    chmod -R 777 .config

    
    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.
    

    then, how and what to do ?

    Happening again with 3.3.3 tried doing all the same things!

  20. avidityindia commented on Oct 26, 2022

    @avidityindia

    Just solved the issue on macOS

    Steps as followed:

    1. https://www.youtube.com/watch?v=IgRi0Z1O_gk&t=111s Follow this video to search for all the android studio files!
    2. Delete all the Android studio folders except the latest one. Also, delete any duplicate android studio application [I was having an Android studio preview].
    3. You are good to go! run flutter doctor
  21. volodyahome commented on Nov 6, 2022

    @volodyahome

    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.

  22. added
    team-tool
    triaged-tool
    on Jul 8, 2023
  23. littletom1 commented on Jan 17, 2024

    @littletom1

    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:

    • of course i haved added flutter path
    • run cmd as administrator
    • turn off firewall
    • add exclusions for folder flutter
      I still got The flutter tool cannot access the file or directory.
      anyone has solutions?
      many thanks
  24. github-actions commented on Jul 24, 2025

    @github-actions

    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 -v and a minimal reproduction of the issue.

  25. locked as resolved and limited conversation to collaborators on Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2a: first houra: qualityteam-tooltooltriaged-tool

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions