I am new to flutter and having problem running flutter doctor. I have extracted the files in another folder and tried setting the path, echo $PATH gives
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
but still on running flutter doctor it says
flutter command is not found
Anybody who can help please ?
Flutter is not yet set in your PATH.
Try:
Step 1:
sudo nano .profile
Step 2:
export PATH="<Path To extracted Flutter directory>/bin:$PATH"
Step 3:
source .profile
Here is official link how to setup flutter environment
Download flutter.zip
Extract the file in the desired location, for example:
cd ~/development
unzip ~/Downloads/flutter_macos_v1.0.0-stable.zip
Add the flutter tool to your path:
export PATH=$PATH:`pwd`/flutter/bin
Try this if you are in ubuntu in terminal
sudo gedit /etc/profile
then add to the end of the file
export PATH=$PATH:`path to your extracted flutter directory`/flutter/bin
Then logout and login or restart
then
if you see flutter/bin in your path it will work. Hop it helps
try this, i hope it can help,
(in terminal)
first,
PATH=$(getconf PATH)
secondly,
export PATH="$PATH:<Flutter directory>/flutter/bin"
Related
A few hours ago I installed Flutter using SNAP, then I ran the "flutter doctor" and it returned the following error...
[ cannot change profile for next exec call: No such file or directory ]
flutter doctor: cannot change profile for the next exec call: No such file or directory
I believe I have to get to the installation directory, but I don't know how to do it.
I ask for help.
Since now, thank you very much for your attention!
I had the similar issue with other package, re-installing the package worked for me.
sudo apt-get reinstall package_name
when I run the flutter doctor command or other flutters command on ubuntu it works fine..
but when I switch to root user with
sudo su
then I run
flutter doctor
then it throws an Error
Command 'flutter' not found, but can be installed with:
snap install flutter
I don't know why this happening can some one help me to find actual problem thanks in advance ..
as #Chance helped me to add flutter path in root bashrc file
i have added flutters path in /etc/bash.bashrc file and now its working in root user also.. thx again #Chance
I am trying to install the flutter version manager to switch the flutter version among the different flutter projects.
I use the command to install the fvm - pub global activate fvm
but when I run the command on the terminal - fvm help
There is an error -bash: fvm: command not found
How to fix it ?
Your .pub-cache binaries are not yet added to your PATH variable, used by your terminal. Add path with the following command:
export PATH="$PATH:$HOME/.pub-cache/bin"
This is the location where fvm is installed. So by exporting this path to your PATH variable you should be able to get fvm working from anywhere in your terminal.
If you installed fvm using pub and you already have it in your path but you are still getting the error, follow these steps:
run dart pub cache repair // You may get an error: Failed to precompile fvm:main:. Just ignore that for now.
run dart pub global activate fvm
you can do a
flutter clean
then when its done, run
dart pub global activate fvm
when it's done it should work now, close the current bash terminal and open a new one
You must add the path to the fvm executable to the $PATH environment variable. After running "pub global activate fvm" you should have seen a warning with instructions on how to fix it. You can watch this: https://youtu.be/R6vKde1vIGQ
That will get you up and running.
if use windows 10 or later add system properties -> Environment Variables -> Path -> %USERPROFILE%\AppData\Local\Pub\Cache\bin
First confirm if fvm.bat is executing successfully, you should have the folder already in environment variable PATH(%USERPROFILE%\AppData\Local\Pub\Cache\bin). If it is then for fvm to run in bash, instead of fvm.bat, you need to create a shortcut, a file named fvm with no extension, the containing folder should also exist in PATH variable, the file contains location to fvm.bat and ends with a whitespace and S*.
I used the command line tools provided by Android to download the SDK tools.Use the command avdmanager create avd -n nexus5_23 -k "system-images;android-23;google_apis;x86_64" --device "Nexus 5" to create the emulator, I found that the mirror path in the file config.ini was image.sysdir.1=sdk/system-images/android-23/google_apis/x86_64/.
Compared with the emulator path created by Win10, the emulator can be started normally after changing it to image.sysdir.1=system-images/android-23/google_apis/x86_64/.
I can't find a solution to this problem in Google.Can you give me some Suggestions? thank you.
The environment:
Ubuntu 16.04 Server
bash.rc
...
export REPO_OS_OVERRIDE=linux
# ANDROID SDK
export ANDROID_HOME=/home/yaorc/android/sdk
export ANDROID_SDK_ROOT=/home/yaorc/android/sdk
export PATH=$PATH:${ANDROID_HOME}/emulator
export PATH=$PATH:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin
export PATH=$PATH:${ANDROID_HOME}/platform-tools
export PATH=$PATH:${ANDROID_HOME}/build-tools/29.0.3
export PATH=$PATH:${ANDROID_HOME}/platforms/android-29
I found the answer after several attempts.
Because my command-line tools are in the SDK root,This causes the system image path to be confused when the avdmanager creates the AVD.
Solution:
I created the cmdline directory in the SDK root, cut the tools folder into the cmdline, and modified the environment variable file to properly create and start avd.
I have installed flutter and set up the path with the zsh file for Catalina version of mac however when I run flutter doctor or flutter precache, I receive zsh: command not found: flutter. NOTE: I managed to get through these steps previously and set up android studio however I had issues when I tried to connect the simulator for Xcode and now I have had to start again.
UPDATE: When running 'flutter' or 'flutter doctor', I receive this error: Error when reading '../../../../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No such file or directory and it says that pub upgrade failed after 10 tries.
How would I solve this?
When I run ls -a in the home directory, I see that there's a .bash_profile, a .zshrc file and a .zprofile (which I created previously) in there. Is this related to the problem?
This looks like you don't have flutter on your PATH in ZSH.
Open your .zshrc file in your terminal with
nano .zshrc
You should see the following at the top of the file
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
Add on the second line the path to the bin directory of your flutter SDK location, like mine:
export PATH=$HOME/bin:/usr/local/bin:$PATH:/Users/joaosoares/Projects/flutter/bin