Home > front end >  Error: No pubspec.yaml file found. This command should be run from the root of your Flutter project
Error: No pubspec.yaml file found. This command should be run from the root of your Flutter project

Time:12-29

I was trying to realease the apk of my flutter application. I ran the,"Flutter Build apk" Command and it poped out this error.

PS C:\Users\Lenovo\Desktop\Weather App> flutter build apk
Error: No pubspec.yaml file found. This command should be run from the root of your Flutter project.

CodePudding user response:

Go to your correct project path then run below command

C:\Users\Lenovo\Desktop\Weather App> // your command

then run the following

for clean the project:

flutter clean

for run the project:

flutter run 

for create APK file of the project:

flutter build apk --release

CodePudding user response:

Run the following commands:

flutter clean

and

flutter pub get

Make sure you're in the root directory. (The folder where the lib, android, etc folders are). If you're using a code editor like Vs Code, check if the terminal is in that folder. If not, cd into it.

CodePudding user response:

make sure you are in root directory of Weather App and also the pubspec.yaml file is there (So it is not deleted mistakenly by you). Do flutter clean then flutter pub get then build apk

  • Related