Cannot Create Flutter Project in Android Studio due to missing pubspec.yaml

Issue

Whenever I create the Create new Flutter Project in android studio, It’s always throwing out this error: Please help.

Could not find a file named "pubspec.yaml" in "/Users/<usrname>/AndroidStudioProjects/inventory_system". pub get failed (66; Could not find a file named "pubspec.yaml" in "/Users/<usrname>/AndroidStudioProjects/inventory_system".)

Solution

First of all make sure your flutter is properly installed on your system. Faced the same issue. Try checking your installation and make sure everything is installed properly. Use this link: https://flutter.dev/docs/get-started/install

Just uninstall android as well as flutter. Try installing them again. First download and install Flutter. Then download and install Android Studio. Follow the proper installation process. I guess your issue is because of the unproper installation.

After flutter installation, open the folder where you have installed it, and open the file flutter_console which is a batch . It will open a console and then type:

flutter doctor

This will show you whether all the installation is properly carried out or not. But a better way is to perform proper installation.

Also you need to set environment variable after the installation.


Here is what happened with me when I installed flutter and android. This is just to show you the issue I had faced after installation

enter image description here

I then followed what was been said as error and got my flutter and android studio working.

enter image description here

Answered By – user16622035

Leave a Comment