Full error:
Flutter failed to delete a directory at "build\flutter_assets". 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.
Error occurs when trying to run flutter run -d chrome
with these notes (all on new freshly created projects):
- If the project is located in C: drive - it works always
- If the project is located in D: drive inside a synced D:\Google Drive\ folder, then it throws the error on 2nd run.
- If the project is located in D: outside of the synced folder - it works always
However, I need it to run inside the synced folder, since I am using multiple locations and computer for development of a project.
Flutter 3.3.2 • channel stable. Only using for Chrome device (web dev). I am using Windows 10. Flutter installed on D:\src\flutter.
List of things I have tried:
- Moving build folder contents to the assets folder instead. Result: runs once, but any additional runs throw the error again. As suggested here.
flutter clean
Result: throws same error- Running
flutter clean
with cmd as an administrator. Result: same error - Deleting the folder manually. Result: complains about another folder with the same error. Once I manually delete all of the ones it complains about, it runs once, but any additional runs throw the error again.
- Restarting computer
- Even tried giving
Everyone
full-access
permissions to the project folder. - Tried installing flutter in different location C:\src\flutter
I been trying to solve this for days and none of the answers I found on the internet work.
Flutter doctor output: https://pastebin.com/9XpHW7T8
EDIT: Tried a few more things and added them to the list. EDIT2: Added another thing I tried. EDIT3: Added flutter doctor output.