Reputation: 1739
I have a minimal makefile used in a flutter project:
run-profile:
flutter run -t lib/main_dev.dart --profile
I run
make run-profile
and get this error
flutter run -t lib/main_dev.dart --profile
make: flutter: No such file or directory
make: *** [run-profile] Error 1
I can run in same terminal totally fine the command flutter
and get normal outputs etc
flutter
Manage your Flutter app development.
Common commands:
flutter create <output directory>
Create a new Flutter project in the specified directory.
flutter run [options]
Run your Flutter application on an attached de
I even modified /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Users/me/flutter/bin
and stil makefile cannot find flutter bin, or i have some syntax error in makefile.
I am on macos big sur 11.4
Upvotes: 1
Views: 1829
Reputation: 3086
You could add it in PATH
variable, the path
where flutter is present before so that it will always consider this path while searching first.
The step can be done inside your makefile
also in below way:
export PATH := /Users/kristi.jorgji/flutter/bin/flutter: $(PATH)
run-profile:
flutter run -t lib/main_dev.dart --profile
Note : Ensure you have flutter
executable present in the path that you mentioned
/Users/kristi.jorgji/flutter/bin/flutter
If flutter executable is present in bin
directory of your mentioned path, then you need to give path till /Users/kristi.jorgji/flutter/bin
Upvotes: 2