Setting up Android Development workbench using Flutter and Android Studio on Ubuntu 16.04 Desktop

Scope:

This document describes step by step activities involved in installing the android development setup with Flutter on Ubuntu Desktop.

Before we start, let me provide you details about my desktop hardware specs. Its a Dell Latitude 3490, core i5 processor with 8GB RAM and 1TB Disk installed with Ubuntu 16.04

This laptop comes with VT enabled by default,if not please enable by rebooting the system and changing below setting in BIOS

Pre-requisites for Flutter installation:

To install and run Flutter, your development environment must meet these minimum requirements:

  • Operating Systems: Linux (64-bit)

bash, curl, file, git, mkdir, rm, unzip, which, xz-utils, zip

Shared libraries: Flutter test command depends on this library being available in your environment.

  • libGLU.so.1 - provided by mesa packages such as libglu1-mesa on Ubuntu/Debian and mesa-libGLU on Fedora.

Once you install these using apt-get (or usually these come be default with Ubuntu 16.04 with continual updates) lets move on to installation of Flutter.

Flutter can be installed using snap usually in U18 or U20 by running below command

sudo snap install flutter --classic

Or we can install manually by the specific version available at https://flutter.dev/docs/get-started/install/linux

cd /opt/
sudo tar xf ~/Downloads/flutter_linux_1.17.5-stable.tar.xz

  • Now add this path to your enviromental variable either by adding below entry to ~/.bashrc or /etc/profile at the end of the line

export PATH=”$PATH:/opt/flutter/bin”

  • Restart the terminal session in order to verify that flutter command executes. You can optionally pre-download development libraries by running command

flutter precache

  • In order to verify all the necessary packages or applications required for flutter exist, you can run below command and anything with Red mark you need to install properly

flutter doctor

[-] Android toolchain — develop for Android devices
• Android SDK at /Users/obiwan/Library/Android/sdk
✗ Android SDK is missing command line tools; download from https://goo.gl/XxQghQ
• Try re-installing or updating your Android SDK,
visit https://flutter.dev/setup/#android-setup for detailed instructions.

Installation of Android Studio:

If you’re using a 64-bit version of Linux, make sure you first install the required libraries for 64-bit machines.

  • To launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and execute studio.sh.
  • Click on next
  • Choose Custom and click Next
  • Let the path be default from OS
  • UI mode either Dark or Light can be selected here
  • Please make sure to select Android Virtual Device ad Android SDK both

Above diagram show the verify the all settings and click the next button.

  • Click on Finish. It will take some time to download and install
  • Click on Configure and it takes to SDK AVD Manager
  • This installs the Build Tools, SDK, Emulator and Platform tools
  • Select hardware which type of mobile we use like tablet, TV etc..
  • Select the model and other specs
  • Click finish to complete
  • Now if you click on the run button, you will see the below screen (it will take some time and a kind of fan sound you will hear. Dont be panic, OS is starting a Virtual Device similar to starting a new server)
  • If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

Installing Microsoft Visual Studio Code on Ubuntu 16.04

  • Browse to https://code.visualstudio.com/download and select .deb version of Ubuntu to download, as it is easy to install

sudo apt updatesudo apt install software-properties-common apt-transport-https wget

  • Next, import the Microsoft GPG key using the following wget command :

wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -

  • And enable the Visual Studio Code repository by typing:

sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

sudo apt updatesudo apt install code

Visual Studio Code has now been installed on your Ubuntu desktop and you can start using it.

Starting Visual Studio Code

Now that VS Code is installed on your Ubuntu system you can launch it either from the command line by typing code or by clicking on the VS Code icon (Activities -> Visual Studio Code).

When you start VS Code for the first time, a window like the following should appear:

You can now start installing extensions by clicking on the Extensions icon in the Activity Bar on the side of VS Code or the View: Extensions command (Ctrl+Shift+X).

This will show you a list of the most popular VS Code extensions on the VS Code Marketplace.

Each extension in the list includes a brief description, the publisher, the download count, and a five star rating. You can click on the extension item to display the extension’s details page where you can learn more.

Please install Flutter and Dart extension:

Updating Visual Studio Code

When a new version is released you can update the Visual Studio Code package through your desktop standard Software Update tool or by running the following commands in your terminal:

sudo apt updatesudo apt upgrade

Final Checks:

In order to confirm that everything required applications and packages are installed, we need to again run the doctor command and make sure that its all Green

(base) mkadmin@mkadmin-Latitude-3490:~$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.5, on Linux, locale en_IN)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.47.2)
[✓] Connected device (1 available)
• No issues found!
(base) mkadmin@mkadmin-Latitude-3490:~$

References:

https://developer.android.com/studio

Thanks for reading. Please feel free to comment or provide your feedback.

MMachine Learning and AI enthusiast