Table of Contents
Download Flutter Installation Bundles & Tools |
Note : By this stage your should have a “workspace” folder on your desktop which contains “android-studio” & “flutter” named folders.
Now proceed with step 3
Create Flutter Project Folders |
Open Terminal, run command :
$ cd Desktop/workspace/android-studio/bin
$ ./studio.sh
./studio.sh above command is used to run android studio setup wizard
Android SDK Path |
Android Studio Setup Wizard
Install Android Studio Linux |
SDK Component Setup - Ensure you have tick mark on
PATH=$PATH:/home/dev/Desktop/workspace/flutter/bin
PATH=$PATH:/home/dev/Desktop/workspace/Android/Sdk
PATH=$PATH:/home/dev/Desktop/workspace/Android/Sdk/tools
PATH=$PATH:/home/dev/Desktop/workspace/Android/Sdk/platform-tools
PATH=$PATH:/home/dev/Desktop/workspace/android-studio/bin
Update PATH variable |
Explanation of the above lines that are added to the .bashrc file
1. flutter bin environment variable
PATH=$PATH:/home/dev/Desktop/workspace/flutter/bin
Note : replace “dev” inside the above command with your username
2. android sdk environment variables
PATH=$PATH:/home/dev/Desktop/workspace/Android/Sdk
PATH=$PATH:/home/dev/Desktop/workspace/Android/Sdk/tools
PATH=$PATH:/home/dev/Desktop/workspace/Android/Sdk/platform-tools
Note : replace “dev” inside the above command with your username
3. android studio environment variable
PATH=$PATH:/home/dev/Desktop/workspace/android-studio/bin
Note : replace “dev” inside the above command with your username
echo $PATH
Open android studio using terminal command studio.sh
$ studio.sh
Install Android Studio Plugins |
Note : Keep your linux system up-to-date (System Updates) which helps in installing common dependencies required by flutter
Accept android-licenses - Mandatory
flutter doctor --android-licenses
Disable Flutter Analytics - Optional
flutter config --no-analytics
Run flutter doctor to test the environment setup
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Android Studio (version 3.5)
[!] Connected device
! No devices available
The above command should show all check marks to ensure that flutter installation is complete.
sudo apt-get install git
Keep your linux system up-to-date (System Updates) which helps in installing common dependencies required by flutter to avoid common errors/warnings while running flutter doctor command.
Get Visual Studio Code Editor - Optional - Download Visual Studio Code
Note : We can use Android Studio or Visual Studio Code Editor [ANY ONE] to develop flutter apps
Launch Emulator using Android Studio AVD Manager
Launch Emulator using VS Code
You can use the default AVD created during Android Studio Setup or create your own AVD.
Error List
Error 1 : KVM is required to run this AVD
$ sudo apt-get install qemu-kvm
Error 2 : User does not have permission to use KVM (/dev/kvm)
$ sudo adduser $USER kvm
above command adds the current user
$ echo $USER
above command prints current username
Check official docs for more details - Android Developer Docs - Emulator Acceleration