Not able to run Flutter doctor on macos

Viewed 128

I installed flutter 3.0.5 on two macbooks, both macbooks are intel chip.

On one MacBook flutter is running fine. On the second macbook, I am able to run flutter channel But when I am running flutter doctor, I am getting this error

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
  • Changing the channel to beta or master also didn't help
  • chown the .config folder didn't help
  • chmod the .config folder didn't help

This error happens by either downloading the SDK and extracting it into the desktop or documents or download folder of my user. And also happens if I just install the flutter SDK using brew

4 Answers

Please Check The Below Permission

  • 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.

  • Read the documentation for proper installation then try again- https://docs.flutter.dev/get-started/install/macos

You can do following thing. As per your query seems to be permission issue where the flutter sdk located.

sudo chown -R <your_username> /flutter_sdk_path/ 

Don't forget to replace your username[the name by which you are logged in in Mackbook] and flutter the SDK path. Once its done then close terminal and open again and run flutter doctor command. Note : updating permission may need restart of system soemtimes.

Redownload the flutter and put it inside your user's directory or just cut that flutter SDK and paste it inside the Users/{yourUserName}/Desktop or Documents folder and map that path to the env variable and also in android studio. Make sure that android studio has enough permissions inside the MAC.

First run flutter cmd like ( use your flutter file path)

export PATH=$HOME/bin:/Users/flutter/bin:$PATH

after run this cmd

Flutter doctor
Related