How do I fix “No pubspec.yaml file found” in flutter?

后端 未结 23 1927
南方客
南方客 2021-02-07 02:46

I am using Windows 10 with VS Code, although I also tested it on PowerShell, and both produced the same result:

After creating a new flutter program, before editing anyt

相关标签:
23条回答
  • 2021-02-07 03:31

    It seems you are running command from the flutter sdk installed folder. Instead you should run the command from the project you have created.

    Match your steps you have done from below mentioned steps:

    1. Clone flutter or unzip flutter sdk (you have downloaded) and move the flutter folder to C drive.

    2. Now check whether the flutter is installed properly or not by running command(flutter --version) from any folder. Make sure you have set the flutter path inside environment variable.

    3. If it is installed, move to any folder where you want to create your project and type this command "flutter create project_name"

    4. Now move to the folder you have recently created and then run "flutter run" from that folder

    I think this will surely help you.

    0 讨论(0)
  • 2021-02-07 03:31

    step 1 : Add this to your package's pubspec.yaml file: url_launcher: ^5.0.2

    step 2: When You come back to main.dart file you can see the get dependencies. when yo click on that link "flutter packages get" command will run. You can get the URL Launcher package

    0 讨论(0)
  • 2021-02-07 03:32

    Maybe you should check to see if the project directory you opened is correct. I had this problem because the project directory opened to the project's parent directory. You must ensure that the file exists in the project directory you have opened.

    0 讨论(0)
  • 2021-02-07 03:33

    @James M, go to command prompt and run

    flutter upgrade
    

    and then try to create a new project using the command

    flutter create new_project
    

    It would work fine.

    0 讨论(0)
  • 2021-02-07 03:35

    You need to execute the following command:

    flutter pub global activate webdev
    
    0 讨论(0)
提交回复
热议问题