I have installed the Android studio and the plugin's DART,FLUTTER to kickstart the flutter but as i am not able to give path of sdk while creating my very first project for flutter.
I tried to find out the solution did not got solution..
Finally this are the steps i have implemented and works for me.
Prerequisites :-
Install Android studio
Install plugins to kick start flutter projects (DART,FLUTTER)
You can find out this inside android studio --> preferences --> Plugins
Now you have to setup Flutter SDK path to your Android studio
Download the Flutter SDK
Extract it where do you want (for example - /Users/vrushali/Downloads/flutter)
Open your Android studio --> start a new Flutter Project --> select default application --> next --> select flutter sdk path --> browse to the . location where you have download and extract your flutter sdk --> select the flutter --> bin --> and say okay
All set..! Your project will get created in some time :)
Theres a better way if you want to skip
Open your Android studio --> start a new Flutter Project --> select
default application --> next --> select flutter sdk path --> browse to
the . location where you have download and extract your flutter sdk
--> select the flutter --> bin
doing every time you open android project
Step1:
open ~/.bash_profile
Step2 paste
PATH="/Users/vrushali/Downloads/flutter/bin:${PATH}"
export PATH
This will add the path permanently
asdf
If you have used asdf to install Flutter SDK.
You can find the location of the flutter by using the following commands,
Open the location of asdf in terminal
open ~/.asdf
Inside the .asdf folder go to installs folder and then to flutter folder. Inside the flutter folder will find the current version of the Flutter SDK as the folder name.
For example, in my case the folder name is 1.12.13+hotfix.7-stable and the path to the folder is /Users/akarshseggemu/.asdf/installs/flutter/1.12.13+hotfix.7-stable
For update flutter SDK path in Mac,
1. First your default shell using echo $SHELL command in Terminal.
2. Use below commane to open vim editor and update Path.
- if it is Bash then type vim $HOME/.bash_profile or vim $HOME/.bashrc
- if Z shell then type vim $HOME/.zshrc
3. Type i to enter INSERT mode (or esc to exit INSERT mode).
4. Type export PATH="$PATH:[YOUR_PATH]/flutter/bin" replacing [YOUR_PATH] with the path to the folder where you moved the flutter folder earlier ex. export PATH="$PATH:/Users/Your_User/Your_Dev_Folder/flutter/bin"
5. Type esc, then :wq! to save and exit.
6. Quit the Terminal and open it again to refresh.
7. Type echo $PATH to check that the path was correctly added.
8. Type which flutter to verify the flutter command is available.
9. Type flutter --version to check the Flutter version.
This worked for me (for ZSH users)
Open terminal & run this command
touch $HOME/.zshrc
Run this command
sudo nano ~/.zshrc
Type the path like this
export PATH=$PATH:/Path to your extracted flutter/Flutter/bin
Press ctrl+x then press y Press Enter Close the terminal and open a
new terminal and run this command
flutter --version
I asked the people that made the flutter plugin and they helped me out. For making flutter work with your IDE (haven't done this in Android but have in VScodium or Vscode).
In command line:
asdf where flutter
In a text document:
export FLUTTER_ROOT="$/asdf/where/flutter/answer/should/go/here"
Add that to your bash_profile above the asdf part. Or your asdf installation won't work.
With nano: ctrl+o, enter, ctrl+x.
Give your IDE the path to the installation, it should work. If not, the change needs to take effect, restart your computer.
Just provide the location where your saved flutter software.
Related
How do I completely uninstall Flutter SDK from Windows?
I tried to delete the Flutter Folder I had cloned from GitHub but that's not working for some reason.
You have to delete flutter extension in Android Studio if you installed it, then, check envirment variables then you removes paths if exists. Finally, kill adb.exe if it's running (this may blocks you in removing folder)
Go to C drive and delete flutter folder completely, if it shows that it Opened in some app, then just restart the device and delete the folder again, it worked for me.
If you go to the dir where you cloned dir and delete it. That should remove the command line tool.
rm -rf flutter
re-install git clone https://github.com/flutter/flutter.git -b stable
Uninstall Flutter with its uninstaller.exe.
to do that
a. Go to the installation folder of Flutter.
b. Find uninstall.exe or unins000.exe.
c. double click and run it.
Dealing with some significant frustration trying to set up my environment variables just to run Flutter. in my path, I've tried many suggestions to try setting up my Path route so that the Flutter Console (or cmd) can successfully run the command "flutter doctor" just to download all the packages, etc. But the problem is as soon as I run this command, it instantly closes my terminal. There isn't anything happening, the terminal just closes. Any help would be appreciated, and I've attached my screenshots of my Path envs to maybe help out some more.
envs
I also get the same problem i.e whenever I hit the flutter doctor command; the terminal instantly closes.
Solution :
Add the following to the system variable path.
C:\Windows\System32\WindowsPowerShell\v1.0
everything will work fine
I was facing the same issue and I resolved it: the problem was PowerShell version.
I am using Windows 8 and by default it has version 4.
Flutter needs version 5.0, so I upgraded my PowerShell.
Add this to system variable PATH:
C:\Windows\System32\WindowsPowerShell\v1.0
Open cmd as admin and set variables:
setx /M FLUTTER_HOME "C:\flutter" <---- here folder where your flutter is
setx /M PATH "%FLUTTER_HOME%\bin;%PATH%"
Add PowerShell path to your PATH in environment variables if not exists.
In my case C:\Windows\System32\WindowsPowerShell\v1.0 added to the PATH
Add Only these in the path and it will surely work. ONLY FOR WINDOWS
enter image description here
Note: Flutter relies on a full installation of Android Studio to
supply its Android platform dependencies. However, you can write your
Flutter apps in a number of editors; a later step discusses that.
(https://flutter.dev/docs/get-started/install/windows)
You could try to install android studio on your machine and try again.
Download Flutter SDK again and change your Flutter SDK path and update new path in
environment variable and restart your IDE
The problem is of powershell only. In my case I mistakenly used ; at the end of path which was creating problem.
Perhaps it's like when you run a bat file and Windows closes it because there's no pause command at the end?
When I ran a bat file with the same command from sublime, i saw that it said this in sublime's output...
C:\!\flutter>flutter doctor
Error: The Flutter directory is not a clone of the GitHub project.
The flutter tool requires Git in order to operate properly;
to set up Flutter, run the following command:
git clone -b stable https://github.com/flutter/flutter.git
Solution: Put your folder at C:\flutter. I don't know why but it fixed this. My PATH is C:\flutter\bin. The "location of the sdk" is C:\flutter.
I have the solution
go to C:/ in windows
create a src folder
into your src folder run this
git clone -b stable https://github.com/flutter/flutter.git
setup your env variables with this path= C:/src/flutter
problem solved!
For me the problem was, that in my BIOS the Virtualization Technology.
in my case non of the answers worked even adding C:\Windows\System32\WindowsPowerShell\v1.0 didn't fix the problem.
the only solution that worked for me is running the command or terminal as an administrator
I've downloaded Flutter SDK as mentioned on https://flutter.io/setup-windows/ and also extracted it. Now when I try to run any Flutter command on the flutter_console.bat or any other CLI the prompts starts blinking forever and nothing happens! I've set the path correctly. Did not find any help from web!
Try running the flutter_console.bat as Administrator
If you delete cache folder under bin to solve some installation issues, this cause a endless loop in flutter doctor. This was my case.
I had the same issue when my flutter directory wasn't located directly in my C:/ drive ("C:/flutter")
I hope you have installed plug-in of flutter and dart
for the working of flutter doctor you need to create system environment variables of - flutter, git , cmd and powershell
like show in image just copy paste path of
**your path may different **
example:
C:\flutter\bin
C:\Windows\System32\WindowsPowerShell\v1.0
C:\Program Files\Git\cmd
C:\Program Files\Git\bin\git.exe
Encountered the same issue on windows. Try extracting the flutter folder in this path C:\Users\YourAccountName\AppData\Local.
Then edit your environment variable and add C:\Users\YourAccountName\AppData\Local\flutter\bin. This solved the issue for me.
I had the same problem, reason was our proxy. I unplugged the network cable and used mobile network of my smartphone via usb host function, that worked for me. After checking and configuring with flutter doctor every following attempt to start flutter doctor or flutter help was successful even with "normal" network.
I extracted flutter to C:\Program Files\ and had same problem. Running command prompt as Administrator did the trick for me. Or extract flutter to another dir where you don't need admin rights.
First, if in your system there is no git installed then first install git.
For my case, I just deleted the whole flutter folder. Download again, extract the folder, cut and paste to the c drive and then update both user variable path and system variable path. I added "C:\flutter\bin" this path inside user variable path and system variable path. Also make sure that:
C:\Windows\System32\WindowsPowerShell\v1.0
C:\Program Files\Git\cmd
C:\Program Files\Git\bin\git.exe
these paths are exist inside the system variable path. Finally I run "flutter doctor" and successfully it run. I also check "dart --version" and there is no problem.
(if you have any confusion about user variable path and system variable path then simply press widow button the type "env" then you will see "Edit the system Environment variables" then press enter and at the last you will see "Environment variables" clik on it and you will see 2 option for variable. One for user variable and another for system variable. select "path" for both and edit.)
My answer is somehow different, although I was using Visual Studio Code, I didn't find the flutter doctor option after pressing ctrl+shift+p.
I solved this issue after finding out, that I didn't choose the trusted system of Visual Studio.
open your path /flutter/bin
then delete cache folder
open terminal
flutter doctor -v
This will fix all problem.
you can just do this>
navigate to flutter bin
cd C:\flutter\bin
C:\flutter\bin> flutter doctor
I installed fresh right now and if you run flutter doctor with console under administrator rights it works for me. If not I have the same behavior as described in your post.
For some reason the latest version that I installed did not work! Installing lower version with same configuration worked!
I tried to open Android Device Monitor and the Studio showed me this message =-O :
It surprised me, because how have I been able to develop Android apps if I didn't have any Java installed?! Actually, Android Studio comes with bundled JDK/JRE (located in /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home), but it is not found by the system: executed usr/libexec/java_home gives
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Setting $JAVA_HOME to /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home did not help — source .bash_profile doesn't like that it's a directory.
QUESTION: I don't want to install new JDK if I already have one inside Android Studio. How do I set it as system default?
Solution:
(Updated 2023) For Android Studio before Electric Eel 2022.1.1 and above: export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home
MacOS versions before Big Sur: add line export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/ to .bash_profile file in your home directory. Run source ~/.bash_profile to update terminal.
Catalina, Big Sur, Mentere and above: add line export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home to .zshenv file in your home directory. Run source ~/.zshenv to update terminal.
After that, running java -version gave this output and Java started to execute normally:
openjdk version "1.8.0_112-release"
OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
OpenJDK 64-Bit Server VM (build 25.112-b06, mixed mode)
As for the Android Device Monitor — it still demands this ancient JRE version 6.
Updated 2023
I just did a fresh install of Android Studio Arctic Fox 2020.3.1 on Big Sur, and I had to use the following.
Android Studio Dolphin and below:
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home
Android Studio Electric Eel 2022.1.1 and above:
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home
On a slightly different topic, even with the correct JAVA_HOME, ~/Library/Android/sdk/tools/bin/sdkmanager wouldn't start. I had to install "Android SDK Command-line Tools (latest)" (from Android Studio) and use ~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager instead.
The core problem is that starting from Android Studio Arctic Fox the destination of bundled java has been changed from:
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/
to:
/Applications/Android Studio.app/Contents/jre/Contents/Home/
You just need to change JAVA_HOME env variable in .bash_profile to the new correct path (be careful with space character, easiest way just to specify path in doubled quotes). And either restart terminal or run source ~/.bash_profile.
As pointed out by dimezis, JAVA_HOME might be working but the /user/libexec/java_home is still broken.
This is because in Mac, java_home and JAVA_HOME are different. JAVA_HOME is the environment variable / path that will be used in most applications and environment while java_home is the actual executable that is being used by the system to run java. Apparently, some Mac applications (like Xcode) will just ignore the JAVA_HOME path and make use of the java_home executable
So in order to use the Android Studio Embedded JDK as default Java to be used in Mac, copy the entire embedded jdk folder /Applications/Android Studio.app/Contents/jre/jdk to the default Java library folder /Library/Java/JavaVirtualMachines/
After this, set your .bash_profile or .zshrc with this:
export JAVA_HOME=$(/usr/libexec/java_home)
This will make sure that your JAVA_HOME and java_home is pointing to the same java installation.
in my case escaping with \ doesn't work but escaping whole path with " works fine. Please reopen terminal to see changes or run source ~/.zshenv to update terminal.
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home/"
Here is how I solved my issue on MAC:
# Android, ADB and JAVA
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home"
From late 2022+, the answer for Mac User & Electric Eel+ has been changed to:
export JAVA_HOME=export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home
to .zshenv file in your home directory
The following worked for me (MacOs Ventura version 13.1)
Enter the following command in the command line export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home.
Create a new folder inside Android\ Studio.app/Contents and called it jre.
Copy the contents of jbr folder into the newly created jre folder.
Run flutter doctor.
Link : flutter issues link
I have three exports path in home/.zshrc mac system
jdk path
path Contains ordinary commands and shell scripts.
Android sdk path
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.5.jdk/Contents/Home
export PATH="$PATH:/usr/local/bin"
export ANDROID_HOME=$HOME/Library/Android/sdk
Solved!
Got to finder and right click it and press ## Show packages content ##
Got to Contents and create a new folder called jre
inside jre copy the content of the jbr folder
the flutter run
I installed Eclipse using the Software Manager (mintInstall) on Linux Mint 15. I am trying to create an Eclipse shortcut on my Desktop via Terminal. I looked it up and found out about the mkshct command. However, I have the following problems:
Where did the Software Manager install Eclipse? (Other applications on too while on this topic)
Am I on the right track using mkshct?
How I solved this issue:
Open the downloaded file (it will have eclipse, eclipse.ini, epl-v10.html, etc.)
Right click on the eclipse file (the same file that launches Eclipse) and click on Make a Link, than drag the link to your desktop.
The Eclipse package also contains icon.xpm if you want to change the link/desktop icon.
Maybe it is in /opt/eclipse/.
P.S. Download from eclipse.org new version and you can run eclipse without installing from the folder.
If you open the Start Menu option on the bottom right, search for Eclipse.
Once you find it (normally found under 'Development') just drag the icon to the desktop and a shortcut will be made for it.
CLI approach:
% which eclipse
% /xxxxxx/xxxxx/xxxxx/xxxx/eclipse
% ln -s /xxxxxx/xxxxx/xxxxx/xxxx/eclipse /yyyy/yyyy/yyyy
where /xxxxxx/xxxxx/xxxxx/xxxx/eclipse is output of % which eclipse and /yyyy/yyyy/yyyy is where you want symbolic-link(shortcut)
we type "which eclipse" to know where your eclipse is installed
first check Eclipse path $ which eclipse
1. $ sudo apt install gedit
2. $ cd Desktop
3. $ touch eclipse.desktop
4. $ gedit eclipse.desktop
5.
syntax:
[Desktop Entry]
Type=Application
Name=Name of your application
Icon=/path/to/icon
Exec=/path/to/application
You have to edit Name, Icon and Exec
[Desktop Entry]
Type=Application
Name=eclipse
Icon=/home/mypc/SOFTWARES/eclipse/icon.xpm
Exec=/home/mypc/SOFTWARES/eclipse/eclipse
Make it executable
chmod u+x eclipse.desktop