I'm trying to run flutter pub get from the root directory of my flutter project which is at C:\users\admin\androidstudioprojects\projectname, but I keep getting the following error:
flutter is not recognized as an internal or external command, operable
program or batch file.
However, there are no issues found when I run flutter doctor from C:\flutter.
These are the paths in my environment variables:
C:\Users\admin\AppData\Local\Programs\Python\Python38-32\Scripts\
C:\Users\admin\AppData\Local\Programs\Python\Python38-32\
C:\Users\admin\AppData\Local\Microsoft\WindowsApps
C:\Users\admin\AppData\Local\atom\bin
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
flutter\bin
C:\Program Files\Git\cmd
C:\Windows\System32
Please try adding the full path of the bin in the PATH variables that would solve it.
Related
Getting error when run the dart pub global activate flutterfire_cli in terminal.ru
Could not find a file named "pubspec.yaml" in "/Users/ammar/.pub-cache/hosted/pub.dartlang.org/quiver-3.2.1".
after login to the fierbase .I run the FlutterFire CLI command in terminal and it give the error
Could not find a file named "pubspec.yaml" in "/Users/ammar/.pub-cache/hosted/pub.dartlang.org/quiver-3.2.1".
You are missing that file it seems like. That is the file for all your dependencies. Did you delete it by any chance? By mistake perhaps?
Even I have the file in lib/ folder flutter gives me error
Here is my file
C:\SRC\flutter\packages\flutter_tools>flutter run
Target file "lib\main.dart" not found.
Edit:
here is my configuration
I have looked to this topic
Getting error like "Target file "lib\main.dart" not found." whlie building APK in flutter
But this situation is different from mine.
Reason:
This is the error because of the main execution starts searching main file, but can't find it.
Solution:
Go to Edit Configurations...
Set here main.dart file as dart entry point here and save it...
Another Solution
Run following command
flutter run -t lib/main.dart
I am trying to setup a path variable for Flutter on my PC. After adding the full path below to the bin folder, when I run the following command in CMD "flutter --version", I get the following result:
'flutter' is not recognized as an internal or external command,
operable program or batch file.
Path: C:\Users\Netchoice\AppData\Roaming\npm; C:\Flutter\flutter\bin
Can someone help me understand why I can't run Flutter from cmd, after adding the flutter bin folder unto the path? Is there something I did wrong? How can I solve this?
So I extracted the files in the C: drive (not the program files) and added C:\flutter\src\bin in the Path variable and when I run flutter --version in cmd it gives an error..please help
It could be great to see what the error is.
I have added all the path environment variables and the flutter doctor command does not give any errors. However, when I try to run the command Flutter Run inside my project, I get the following error:
I have added all the path variables correctly. I get the same error if I try to run this project from within Android Studio.
It turns out that my project was nested very deeply. SO it's better to keep you project outside. It's works after that.