flutter has exited unexpectedly FileSystemException :Creation Failed path=directory\lib OS Error: The system cannot find the file specified, errno = 2

Viewed 43

I an tring to create a new flutter project with flutter3.3.0 but suddenly came below exception. enter image description here after run flutter doctor, enter image description here

enter image description here not create any directory in project

enter image description here

also change variables

1 Answers

I have got this error for the first time when I create the flutter project using Android studio.

These steps help me to fix the error;

1.Remove existing flutter folder.

2.go to this link: flutter.dev/docs/get-started/install/

3.Install flutter again inside a new folder. (Follow instructions carefully.)

Do not install Flutter in a directory like C:\Program Files\ that requires elevated privileges.

4.Set environment variable again.

5.run flutter doctor (There will be no errors if you set up everything correctly.)

6.Create a project inside your project directory. (Create project with new location)

Done :)

Related