Flutter Tutorial : Installing flutter on Linux (without Android Studio)

Share on facebook
Share on twitter

Flutter Tutorial : Installing flutter on Linux (without Android Studio)

24 479 views | 1 May. 2019
24 479 views | 1 May. 2019

Watch this video if you want to learn how to setup Flutter, Android Command Line tools and Microsoft Visual Studio Code for development. This will come in handy if you are hoping to become an Android or iOS app developer. This tutorial shows your how to install Flutter, Android Command Line tools and Visual Studio Code on Linux Operating Systems such as Linux Mint or Ubuntu as well as creating an AVD (Android Virtual Device)

Flutter is an open-source app development SDK for both Android and iOS made by Google. Flutter is great if you want to make Android and iOS versions of your app without having to have 2 developer teams (For Android and iOS)

It should be noted that this video tutorial will show you how to install flutter without Android Studio. I've asked few times "How do you install flutter without Android Studio?" and this is how. You install Android Command Line Tools instead.

_________________________________________________________________

JDK 8

$ https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Install JDK

$ cd /usr/lib/jvm

$ sudo tar -xvzf ~/Downloads/jdk-8u211-linux-x64.tar.gz

$ sudo nano /etc/environment

$ J2SDKDIR="/usr/lib/jvm/jdk1.8.0_211"

$ J2REDIR="/usr/lib/jvm/jdk1.8.0_211/jre"

$ JAVA_HOME="/usr/lib/jvm/jdk1.8.0_211"

$ DERBY_HOME="/usr/lib/jvm/jdk1.8.0_211/db"

$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_211/bin/java" 0

$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_211/bin/javac" 0

$ sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_211/bin/java

$ sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_211/bin/javac

$ update-alternatives --list java

$ update-alternatives --list javac

$ java -version

git

$ sudo apt install git

Flutter

$ https://flutter.dev

Android Command Line Tools

$ https://developer.android.com/studio/#command-tools

Visual Studio Code

$ https://code.visualstudio.com

Setting up the emulator

$ sdkmanager "system-images;android-28;google_apis_playstore;x86_64"

$ sdkmanager "platform-tools"

$ sdkmanager "build-tools;28.0.3"

$ sdkmanager "platforms;android-28"

$ sdkmanager "emulator"

Accept licenses

$ sdkmanager --licenses

Creating Android Emulator

$ avdmanager create avd -n pixel -k "system-images;android-28;google_apis_playstore;x86_64" -d 19

Running emulator from Terminal with Audio

$ emulator @pixel

Running emulator from Terminal without Audio

$ emulator -noaudio -avd pixel

Install kvm (If necessary)

$ sudo apt install qemu-kvm

$ sudo adduser username kvm

$ sudo chown username /dev/kvm

FaceBook: https://www.facebook.com/Knowledgify

Twitter: https://twitter.com/Knowledgify1

Sean Kiong

this tutorial is very clear and easy to understand. a real step by step from where to download and how to install it. good job

onlyCodes

Thanks you a lot .

Shivam

Why do we need Java SDK for flutter?

Anhar Nendra

i cant run sdkmanager on terminal

Aby sebastian

can't we use java 12 in installing flutter ?

EMMANUEL OKELLO

Works perfectly, my computer couldn't support virtualization so I couldn't run the emulator,
So I decided to use my real android and iPhone devices.

Khaleepha Uba

I am running Ubuntu so Java Path is working because I run sdkmanager and pop errors. So how to set the Java Path?

Andrey Gil

"Could not find a Flutter SDK. Please ensure flutter is installed and in your PATH (you may need to restart)."
What could it be? I've searched already, but don't finded a answer.

I.D

Thank you a lot bro!!!

Oliver Queen

Thanks for the tutorial :) i got my problem resolved :)

Oben Desmond

thanks so much, God bless

Denniszen

It says here without android studio. Isn’t it necessary to install android studio?

Makolo Herbert

i swear your video is soo nice bro.. it has been so helpful to me. keep it up bro..

Paterne Tia

when i do sdkmanager nothing is do . i just see my prompt pls helpe me

Krishan Bagri

getting Warning: Could not create settings when run sdkmanager

panji jayasutra

How to fix this error when running sdkmanager on termintal
Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)

K163623 Kiran Tanweer

whenever I write sdkmanager on terminal I get the following error

Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)

Please help

Shereen V. F.

Wonderful tutorial! Great job! I had a hard time doing this on my own, but you video is very helpful, even when I faced issues of my own, they weren't hard to solve. Thanks for your time and effort :)

Anhar Nendra

i dont run sdkmanager on terminal

portal coding

I found an error when running the sdkmanager command,

Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Usage:
sdkmanager [--uninstall] [<common args>] [--package_file=<file>] [<packages>...]
sdkmanager --update [<common args>]
sdkmanager --list [<common args>]
sdkmanager --licenses [<common args>]
sdkmanager --version


With --install (optional), installs or updates packages.
By default, the listed packages are installed or (if already installed)
updated to the latest version.
With --uninstall, uninstall the listed packages.


<package> is a sdk-style path (e.g. "build-tools;23.0.0" or
"platforms;android-23").
<package-file> is a text file where each line is a sdk-style path
of a package to install or uninstall.
Multiple --package_file arguments may be specified in combination
with explicit paths.


With --update, all installed packages are updated to the latest version.


With --list, all installed and available packages are printed out.


With --licenses, show and offer the option to accept licenses for all
available packages that have not already been accepted.


With --version, prints the current version of sdkmanager.


Common Arguments:
--sdk_root=<sdkRootPath>: Use the specified SDK root instead of the SDK
containing this tool


--channel=<channelId>: Include packages in channels up to <channelId>.
Common channels are:
0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).


--include_obsolete: With --list, show obsolete packages in the
package listing. With --update, update obsolete
packages as well as non-obsolete.


--no_https: Force all connections to use http rather than https.


--proxy=<http | socks>: Connect via a proxy of the given type.


--proxy_host=<IP or DNS address>: IP or DNS address of the proxy to use.


--proxy_port=<port #>: Proxy port to connect to.


--verbose: Enable verbose output.


* If the env var REPO_OS_OVERRIDE is set to "windows",
"macosx", or "linux", packages will be downloaded for that OS.




I need help to solve this

Janhavi Tripurwar

After flutter doctor command I am getting this error "Flutter requires Android SDK 29 and the Android BuildTools
28.0.3" I tried everything mentioned on stackoverflow but not working, please hep.

Skrr Prrrh

When VS code asks for Dart SDK it located in flutter/bin/cache. For future readers

Chanchal Sadhukhan

Sir, if i want to use my android device using usb-debugging which should I do ??

Paterne Tia

Emulator command not found for me. I need help

Mahmoud Anwar

tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Abdelrhman Shokr

It worked perfectly for me but here is the issue now when I run it it slows my laptop down so much that I have to restart it is it normal ? I think not because in the video it works just fine like any other app so can any one recommend a solution to it ?

Suvarna Kale

solution
sdkmanager
warning: could not create setting ..
unzip downloaded file in home as it is , not only "tool" .. rename it with cmdline-tools .. set export path pwd/cmdline-tools/tools/bin ..

Rafael Dalzotto

[ERROR][SOLVED]

If you have this error when executing $sdkmanager : "Warning: Could not create settings"

You can solve it with this:
https://stackoverflow.com/questions/60440509/android-command-line-tools-sdkmanager-always-shows-warning-could-not-create-se

Now my folder structure is:
$HOME/android-sdk/cmdline-tools/tools/bin

And the .bashrc looks like:

export PATH="$PATH:/home/user/flutter/bin"
export ANDROID_HOME="/home/user/android-sdk"
export PATH="$PATH:$ANDROID_HOME/cmdline-tools/tools/bin"

At the end of the install run the command:
$ flutter config --android-sdk "$ANDROID_HOME"

Note: I got this error at the minute 12:04 of the video

KineChi

finally i found this tutorial... my os get corrupt because of the "path" lost... thanks sir

Gabriele :D

How can i update the sdk manager?

Bakemono CH

can someone help me? why there's an emulator directory since he didn't create it?

KARTHIKEYAN NATARAJAN

where to find jvm folder before extracting jdk?? there is no jvm folder(ubuntu)

Sumia Omer

display below error when type flutter run command... how can solved??

Error running Gradle:
ProcessException: Process "/home/sumia/Documents/FlutterApps/mydemo/android/gradlew" exited abnormally:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not download builder.jar (com.android.tools.build:builder:3.2.1)
> Could not get resource
'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.2.1/builder-3.2.1.jar'.
> Read timed out

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 26s
Command: /home/sumia/Documents/FlutterApps/mydemo/android/gradlew app:properties



Please review your Gradle project setup in the android/ folder.

★MrNiaMsTeR

help please iam stuck here when i type sdkmanager it shows this :



[email protected]:~$ sdkmanager




Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Usage:
sdkmanager [--uninstall] [<common args>] [--package_file=<file>] [<packages>...]
sdkmanager --update [<common args>]
sdkmanager --list [<common args>]
sdkmanager --licenses [<common args>]
sdkmanager --version

With --install (optional), installs or updates packages.
By default, the listed packages are installed or (if already installed)
updated to the latest version.
With --uninstall, uninstall the listed packages.

<package> is a sdk-style path (e.g. "build-tools;23.0.0" or
"platforms;android-23").
<package-file> is a text file where each line is a sdk-style path
of a package to install or uninstall.
Multiple --package_file arguments may be specified in combination
with explicit paths.

With --update, all installed packages are updated to the latest version.

With --list, all installed and available packages are printed out.

With --licenses, show and offer the option to accept licenses for all
available packages that have not already been accepted.

With --version, prints the current version of sdkmanager.

Common Arguments:
--sdk_root=<sdkRootPath>: Use the specified SDK root instead of the SDK
containing this tool

--channel=<channelId>: Include packages in channels up to <channelId>.
Common channels are:
0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).

--include_obsolete: With --list, show obsolete packages in the
package listing. With --update, update obsolete
packages as well as non-obsolete.

--no_https: Force all connections to use http rather than https.

--proxy=<http | socks>: Connect via a proxy of the given type.

--proxy_host=<IP or DNS address>: IP or DNS address of the proxy to use.

--proxy_port=<port #>: Proxy port to connect to.

--verbose: Enable verbose output.

* If the env var REPO_OS_OVERRIDE is set to "windows",
"macosx", or "linux", packages will be downloaded for that OS.

Kalaiselvan Mohan

Hi friends, Please help me with this.
While running $ sdkmanager "system-images;android-28;google_apis_playstore;x86_64"

I'm getting this Warning
Warning: An error occurred during installation: /tmp/PackageOperation04/unzip/x86_64/system.img: Operation not permitted.

Even after continuing with the above warning, While creating a virtual device getting Error
$ avdmanager create avd -n pixel -k "system-images;android-28;google_apis_playstore;x86_64" -d 19
Error: Package path is not valid. Valid system image paths are:ository...

Nilay Sheth

I don't have jvm folder . What to do?

damou walid

thnx for this tuto but how to download android-sdk ?

sarandhanush sarandhanush

is this causes any problem..i stuck here ..help me..how to solve such exceptions when checking sdk manager

Muhammad Lutfi Rahmawan

I got an error when typing "sdkmanager" comand
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more

Rafael Arianto

I have a question. I already have jdk 11.0.4
Does the version difference matter?
Please help. Thank you

Code Bill

Where did you get sdk?

Haris Inspirasimu

masih gagal ketika sampai "sdkmanager" kenapa ya

smoking lava

rlly helpful

SB Technology

Its say flutter command not found how to fix

Sagar Kumar Bala

One of the best flutter installation tutorial, in youtube. But i must say for the future readers that, u dont need JDK 8 for this to work ;any version 8< works fine... u just need to edit some file manually thats it, u r good to go. JDK 8 having that EE module, which helps sdkmanager to works flawlessly, but there are many hacks available according to ur JDK version in Github , stackoverflow for flutter to work. (JDK 8+ is good to go, <JDK8 i dont know..me personally using JDK 14).

Menoubia Corentin

please i have a problem at the level of export PATH="$PATH:`pwd`/flutter/bin", i have tried putting the location where my flutter has been extracted but when i run the next command (flutter) i receive an error message bash: flutter: command not found
please can anyone help??

sarandhanush sarandhanush

i have installed java jdk 12 instead of jdk 8

Ayush Ghosh

Thanks for the tutorial sir, it helped out a lot.
For people out there getting error for licenses, install cmdline tools from the sdkmanager

How to Joker

hii bro
nothing works well after checking sdk manager...it shows some exceptions..


it shows
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more

BiGoTiER

Great tutorial!!!

sandile khendle

./emulator @pixel
emulator: WARNING: Not all modern X86 virtualization features supported, which introduces problems with slowdown when running Android on multicore vCPUs. Setting AVD to run with 1 vCPU core only.
Warning: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled ((null):0, (null))
emulator: INFO: QtLogger.cpp:66: Warning: QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled ((null):0, (null))


queryCoreProfileSupport: swap interval not found
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
emulator: WARNING: Ignoring invalid http proxy: Bad format: invalid port number (must be decimal)
Segmentation fault (core dumped)





I am getting the error above what might be the problem?

Ayyuby Test

i got error


Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)

Alex Berenson

I have been searching for this solution for like 2 days continuously and when I finally complete all the steps I was really very relieved. Thanks for the solution. It saved my PC from the hungry Android Studio at least. Cheers.

Yosua juliando

Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Usage:
sdkmanager [--uninstall] [<common args>] [--package_file=<file>] [<packages>...]

Abdelrhman Shokr

when I run sdkmanager it replies with an error => Warning: Could not create settings
java.lang.IllegalArgumentException can any one help me please ?

Vishnu Muskawar

Hi
I am getting this error in Ubuntu 20.

E0520 11:06:29.866803544 5261 socket_utils_common_posix.cc:201] check for SO_REUSEPORT: {"created":"@1589952989.866791260","description":"SO_REUSEPORT unavailable on compiling system","file":"/mnt/tmpfs/src/android/emu-master-dev/external/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":169}
checkValid: hw configs not eq

The emulator is stuck at loading screen only.

sarandhanush sarandhanush

nothing works well after checking sdk manager...it shows some exceptions..

Naveen Kumar

use java 8 ,please dont use jdk11

Fernando da Silva Cares

Thanks for your tutorial! It helped me so much, i'm very happy! Waiting for new videos!

NATURE HEALING POWER

I respect you from the bottom of my heart❤️❤️❤️❤️❤️........thank you sir........

Holla Holla

please help even i followed along everything is okey except the sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_211/bin/java" 0
"doesnt exisit"

Softecnico TV

hi, I have the following error when executing the flutter command gives me this problem Oops; flutter has exited unexpectedly.
Sending crash report to Google.
Crash report sent (report ID: 4b62207816e386c2)
Crash report written to /home/softecnico/flutter_02.log;
please let us know at https://github.com/flutter/flutter/issues.