skip to Main Content

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:

image

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

Flutter failed to delete a directory at "buildflutter_assets"

I want to execute this application on web or android.
Want to provide flutter tool the access to file or directory.

4

Answers


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

    Login or Signup to reply.
  2. Give it a try it worked for me.

    run command in vs code or android studio terminal

    flutter clean
    
    flutter pub get
    

    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

    Login or Signup to reply.
  3. 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 be HP_PC or HPPC or any valid string. Here are few ways you can troubleshoot this issue.

    • Rename the user account. Examples: mypc, my_pc, MyPc, myPC,
      etc.
    • Change the working directory to the path that doesn’t contain
      space/s. Example: C:UsersPublic etc.
    • Create a new user with a name having no space/s.

    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.

    Login or Signup to reply.
  4. This was my error when try to debug the Flutter app on my Android smartphone>:

    Unable to delete directory 'C:UsersJean-PierreDevelopmentFlutteraudio_learnbuildappoutputsapkdebug' 
    Failed to delete some children. This might happen because a process 
    has files open or has its working directory set in the target directory.
    

    The problem could only be solved by restarting Windows 10.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search