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
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
Related
As a Flutter developer, I've been working on many projects. I have to work on all of them occasionally. Now those projects lie in a single directory occupying 30+ GB on my drive. It'd be a good idea to have the project's build-cache deleted to save some space. So I figured to write a script that would loop through each of them and run flutter clean inside every folder instead of running the command manually under each project's root.
After Google and StackOverflow search I came up with a command :
for /D %G in ("D:\MyProjects\*") do flutter clean "%~fG"
Well this command executes the flutter clean command for each folder like:
C:\Users\vipin>flutter clean "D:\MyProjects\Project1"
C:\Users\vipin>flutter clean "D:\MyProjects\Project2"
C:\Users\vipin>flutter clean "D:\MyProjects\Project3"
C:\Users\vipin>flutter clean "D:\MyProjects\Project4"
This should have worked since the command states to run flutter clean for each folder as it looked. Unfortunately, it didn't and threw error:
C:\Users\vipin>flutter clean "D:\MyProjects\Project1"
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
C:\Users\vipin>flutter clean "D:\MyProjects\Project2"
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
C:\Users\vipin>flutter clean "D:\MyProjects\Project3"
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
C:\Users\vipin>flutter clean "D:\MyProjects\Project4"
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
...
Well, the pubspec.yaml files are very much present in each folder and I figured that the flutter clean command demands your prompt pointing to Project's ROOT, like below to do the job:
D:\Myprojects\Project1>flutter clean
Now I'm looking for a command/script anything to move the command's prompt to each project's root and execute the command.
Glad you asked. I had the same thought about doing it to my list of projects. The below command will do exactly what you expect. Make sure to run this from D:\MyProjects
for /d %i in (D:\MyProjects\*) do ( cd "%i" & flutter clean )
I am setting up my yocto project, for that i have followed these below steps:
download the Poky Source code (ubuntu: /yocto/source)
$ git clone git://git.yoctoproject.org/poky
Checkout the latest branch/release (zeus)
$ git checkout zeus
Step 3: Prepare the build environment (ubuntu: /yocto/source/poky)
$ source oe-init-build-env ../../build
The above script will move in a build folder and create two files in conf folder ( local.conf, bblayers.conf ) inside conf folder
Building Linux Distribution (unbuntu: /yoctu/build)
$ bitbake core-image-minimal
Checking the runqemu (ubuntu: /yocto/source/poky/scripts)
$ ls runqemu // and it is there
Run generated image in qemu (ubuntu: /yocto/build)
$ runqemu qemux86-64 core-image-minimal
other window open for qemu and image runs well.
Problem
After using first time when i close the terminal, and use it again by running $ runqemu qemux86-64 core-image-minimal in (ubuntu: /yocto/build) error pops up runqemu: command not found and if i write bitbake in poky directory same error pops up bitbake: command not found.
NOTE: i have repeat this whole process 3 times to check if the installation is not correct but i have done everything fine from my side.
yocto project hierarchy:
If you close your poky environment terminal you always MUST re-source the environment.
The poky's oe-init-build-env setups up all commands for you, for instance:
runqemu* commands which are present in poky/scripts.
The script also export bitbake* commands from poky/bitbake/bin.
The line responsible for that is in:
poky/scripts/oe-buildenv-internal (line 99):
# Make sure our paths are at the beginning of $PATH
for newpath in "$BITBAKEDIR/bin" "$OEROOT/scripts"; do
# Remove any existences of $newpath from $PATH
PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")
# Add $newpath to $PATH
PATH="$newpath:$PATH"
done
So, always if you open new terminal:
source /yocto/source/poky/oe-init-build-env /yoctu/build
EDIT
If you already have a build folder, make sure to provide the right path for that folder to the oe-init-build-env script.
If you provide new path to non-existing folder, than the script will create another build for you.
EDIT2
To source poky environment according to your path:
Relative:
cd ~/Documents/yocto/source/poky
source oe-init-build-env build
^
|
(because build is in same folder as the script)
Absolute:
source /home/$USER/Documents/yocto/source/poky/oe-init-build-env /home/$USER/Documents/yocto/source/poky/build
THE RULE
source <path/to/oe-init-build-env> <path/to/build/folder>
If <path/to/build/folder> exists then, poky will source the existing build environment.
If <path/to/build/folder> does not exist, poky will create new build under the same name and path.
My apologies if the title of the question isn't clear enough, here is a better explanation of the problem I am facing, so I am trying to write a shell script to run on app center to deploy my application for tests/production. the script is as follows
#!/usr/bin/env bash
# fail if any command fails
set -e
# debug log
set -x
cd ..
git clone -b beta https://github.com/flutter/flutter.git
export PATH=$(pwd)/flutter/bin:$PATH
flutter channel stable
flutter upgrade
flutter doctor
flutter clean
rm -f ios/Podfile.lock pubspec.lock
rm -rf ios/Pods ios/Runner.xcworkspace
flutter build ios --release --no-codesign
nothing much going around here, first of all, I install flutter then set the path to it,
make sure flutter is installed correctly, then clean up (just an extra thing I am doing) then remove the old podfile, public.lock pods and the runner.xcworkspace the reason is to make sure that every time I want to generate a brand new file for the build, anyways, running the script will fail and result in the following error message
lib/pages/reset_password_page.dart:24:62: Error: 'InputWidgetState' isn't a type.
final GlobalKey<InputWidgetState> _phoneNumKey = GlobalKey<InputWidgetState>();
^^^^^^^^^^^^^^^^
Failed to package /Users/muhammad/Desktop/test/OrbitFoodCustomerApp.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/muhammad/Desktop/test/OrbitFoodCustomerApp/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'libPhoneNumber-iOS' from project 'Pods')
the error message is longer than that but it is kind of repertative and that's the most important part. the really weird part for me is when I modify the script in the following way
#!/usr/bin/env bash
#Place this script in project/ios/
# fail if any command fails
set -e
# debug log
set -x
cd ..
# git clone -b beta https://github.com/flutter/flutter.git
# export PATH=$(pwd)/flutter/bin:$PATH
flutter channel stable
flutter upgrade
flutter doctor
flutter clean
rm -f ios/Podfile.lock pubspec.lock
rm -rf ios/Pods ios/Runner.xcworkspace
flutter build ios --release --no-codesign
note that the export path is commented out so this time the script will use the flutter installed on my machine, the script succeeds in building the app which I find very weird, I checked the flutter version of both flutters (the newly downloaded and the one on my machine) and they are exactly the same. same branch same version the same everything. but for some reason using my own flutter succeeds while using the downloaded flutter fails.
please note that both the scripts are being run on my own machine, the only difference is that I am specifying the flutter path in one script and I use my previously installed flutter in the other one, and I made sure to specify that targeted deployment ios version to be 12 anywhere possible.
any idea what's going on?! I am very confused. thank you in advance.
I am trying to install Akeneo PIM Community Edition on my macOS Catalina following these instructions: https://docs.akeneo.com/4.0/install_pim/docker/installation_docker.html
Steps using Docker are successful until I want to launch PIM in prod mode using the command
$ make prod
when I get the error message: make: *** No rule to make target `prod'. Stop.
I execute this command inside the 'pim' directory in my home directory (~iwan/pim).
Instructions say the make command needs to be executed within directory /srv/pim but I do not find this directory on my Mac.
Where do I find /srv/pim or what went wrong?
Thanks for any help,
Iwan
in directory ~iwan/pim (pim is a subdirectory in my home directory (iwan))
The /srv/pim directory exists inside the pim_fpm_1 container and is mapped via a volume to your ~/iwan/pim directory.
There should be a Makefile in this directory with lines like these:
.PHONY: prod
prod:
$(MAKE) dependencies
$(MAKE) pim-prod
(The Makefile was created when you ran the commands under https://docs.akeneo.com/latest/install_pim/docker/installation_docker.html#creating-the-pim-project)
I created a new flutter project using flutter create. The path to pubspec.yaml is D:\dev\flutter\example\
But when I run flutter run in my projects, it gives an error: pubspec.yaml not found in D:\dev\flutter\
Why is flutter pub get running in the parent directory of my project?
I solved it. my bad i didnt look at my pubspec which contained
dependencies:
flutter:
sdk: flutter
responsive_framework:
path: ../
the 'path' was causing it to run pub get in parent directory.
Move to the folder you have recently created-
cd example
Then run "flutter run" from that folder.
Go to your project directory by:
cd D:\dev\flutter\example
Then run:
flutter clean
flutter run