The following steps are there to be followed for a successful installation.
- Downloading and setting the path of JAVA.
- Downloading and setting the path of Android SDK.
- Installing Flutter in Linux and setting the path.
- Solving flutter run issues.
1. Install JDK 6 or later
First, we will install Oracle JDK 8. Run the following commands on the terminal in Ubuntu.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
To make sure, it’s installed successfully, open a terminal and type
2. Download and install Android Studio
- Tested on Ubuntu® 16.04 LTS
- 64-bit distribution capable of running 32-bit applications
- 3 GB RAM minimum, 8 GB RAM recommended; plus 1 GB for the Android Emulator
- 2 GB of available disk space minimum,
4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image)
- 1280 x 800 minimum screen resolution
Download the Android Studio package for Linux and extract it somewhere (e.g home directory).
To launch Android Studio, open a terminal, navigate to the
android-studio/bin/ directory, and execute
Select whether you want to import previous Android Studio settings or not, then click OK.
Download the various files of the Android SDK. By default, the Android Studio installation process forces you to download the latest Android SDK, so you have to download that.
After downloading the latest Android SDK, Click on ‘Start a new Android Studio Project’. This will create a sample Android project. The initial build of the first sample project takes some time as Android Studio builds the project and sets all the default settings in the system.
If you want to setup a desktop entry for Android Studio then you can do it by clicking on Tools menu -> Create Desktop Entry.
Now you can open Android Studio directly from the launcher. You can also pin Android Studio to the launcher.
Android Studio sets the path of its SDK automatically, so you don’t need to configure it.
3. Download and install Flutter
You can download the Flutter SDK from flutter.io for Linux version.
You’ve to have a 64 bit os to install it , so at first confirm that you have the 64 bit version of Linux.
- Operating Systems: Linux (64-bit)
- Disk Space: 600 MB (does not include disk space for IDE/tools).
After downloading the Flutter SDK, you should extract the file in the desired location, for example:
$ tar xf ~/Downloads/flutter_linux_v1.2.1-stable.tar.xz
By running the above commands, you will extract the Flutter SDK at Documents folder.
Now you need to update the PATH to add the Flutter SDK.
Open a terminal and go to the home directory and then to current user directory by typing the following command.
Type the following commands to update the path.
A file opens for editing. Be careful while dealing with this file as this is the file that contains the system configurations.
At the end of this file add the path of the Flutter SDK.
The above example works if the Flutter SDK is in the home directory.
Save and close the file and then also close the terminal.
echo$PATH in another terminal to see the updated path.
This will show you the updated path which contains the Flutter SDK.
flutter doctor in the terminal. If no errors were there then
flutter doctor will run successfully.
4. Download and install the Flutter plugin in Android Studio
Now you just need to install Flutter plugin in Android Studio. You can do this by going into File->Settings->Plugins and then search for Flutter in ‘Search in repositories’ and from there you will install Flutter and Dart plugin for Android Studio.