Flutter error while try to run in macbook m1

610 Views Asked by At

Launching lib/main.dart on sdk gphone64 arm64 in debug mode... main.dart:1 Exception: 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.

Exited

but when with other flutter projects it can be built but this project can't

enter image description here

2

There are 2 best solutions below

0
youhaveme On

I have faced the same issue. There is some extended attribute issue. Use this command

sudo xattr -c -r  <project_folder_path>

Read the man page of xattr for more information.

0
Adil Shinwari On

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.