0

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.

Neeraj Manhas
  • 23
  • 2
  • 6
  • Confirm whether Weather App is the root directory of your project. – Bmbariah Dec 29 '21 at 08:26
  • Does this answer your question? [How do I fix "No pubspec.yaml file found" in flutter?](https://stackoverflow.com/questions/49786432/how-do-i-fix-no-pubspec-yaml-file-found-in-flutter) – zabaykal Dec 29 '21 at 08:27

3 Answers3

0

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
Ravindra S. Patil
  • 11,757
  • 3
  • 13
  • 40
0

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.

0

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