I’m working on flutter to develop a "map-navigation app". I’m new to it. It showed "some of the dependencies are outdated" so I update the packages and pub files, after that the application is not running on any of the platform (i.e. Desktop, Web, android and ios). It shows the following given error.
Also tried manually deleting the build folder from the project and then executing the app, still facing the same error.
Manually deleting the build folder, applying flutter clean
command then running the app still shows the error below:
Launching libmain.dart on Chrome in debug mode...
Flutter failed to delete a directory at "buildflutter_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.
Waiting for connection from debug service on Chrome...
I want to execute this application on web or android.
Want to provide flutter tool the access to file or directory.
4
Answers
The problem is probably because it is not a good idea to have a space in the path to a flutter project ie. ‘HP PC’ would be better named with an underscore instead of the space character.
The flutter documentation warns you of this here https://docs.flutter.dev/get-started/install/windows
Give it a try it worked for me.
run command in vs code or android studio terminal
repeat this 5-7 times restart whole project,PC and reinstall the build in your mobile
if you still have any error you poke me out here I will leave my linkedin
For anyone who faces this issue in future, as mentioned by @GrahamD this issue is because of space in the path. In this case it’s
HP PC
that should beHP_PC
orHPPC
or any valid string. Here are few ways you can troubleshoot this issue.mypc
,my_pc
,MyPc
, myPC,etc.
space/s. Example: C:UsersPublic etc.
After moving your directory, run
flutter clean
command and then run your project again. It should work now.Note: You may need to install software if you create a new user account.
This was my error when try to debug the Flutter app on my Android smartphone>:
The problem could only be solved by restarting Windows 10.