Configure Flutter development environment on a low-end laptop

Awais iqbal
4 min readApr 11, 2021

Configuring Flutter development environment is not difficult. But when it comes to configuring it on a low end laptop with just 4 GB of ram things becomes very difficult because opening android android,vs-code and android emulator all at the same time will take up all of your memory and your laptop will simply stop responding. About a six month ago, I decided to learn flutter
So I installed Flutter and all other required programs But things didn’t go well and I had to abundant the idea of learning flutter because of hardware limitations. Every time I tried to launch the android emulator my laptop hanged and I had to hard reboot my laptop.

A few weeks ago, I decided to give Flutter another try. I did some research
on how other people have configured their flutter development environment.And found that you actually don’t need Android studio program. All you need is android SDK which we will install separately. You don’t even need to install android emulator and can use a physical device, which will certainly reduce load on your laptop.

This was my setup 6 month ago that didn’t work.

  • OS : windows 10
  • laptop with 8 GB of RAM.
  • Android studio
  • Visual studio code

This is my setup now that works.

  • OS: Arch Linux
  • Laptop with 4 GB of RAM
  • Only android studio tools that are required by Flutter.
  • Text Editor : Neovim
  • And my android mobile phone

Even though now I have a laptop with just 4 GB of ram. BUT IT STILL WORKS!

Why Linux

If you are using windows 10 for development work. It’s time to shift to LINUX!!. Windows 10 uses almost 2 GB of your ram and in some cases even more. While many Linux distro uses less than 1 GB of ram, and some even uses less than 500 MB. Many people think that Linux is very difficult to use and you need to know a lot of commands to use Linux. But it’s not the fact. In recent years it has improved a lot.If you are a developer, you should give Linux a try .If you have decided to install Linux, I would recommend Manjaro Linux.
It’s based on Arch Linux and it’s the best distro for newbie.Installing Linux is also easy. You can follow this tutorial to install Manjaro

Why Neovim
There is no doubt that visual studio code has every thing that you one would expect from a modern IDE. But it has one limitation that it uses too much RAM. Therefore, we are going to use Neovim. In next blog I’ll write about how to configure Neovim for flutter development.

Let’s start configuring flutter

Requirements:
OS: Manjaro / Arch Linux

Installing Yay package manager
We are going to install almost all of packages from Arch User Repository
For that you need to install yay package manager.
Open your terminal and run this command.

pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Installing Flutter

yay -S flutter

Make sure that you have openjdk 8 or 10 by this command

java -version

if your java version is other than 8 or 10 then install openjdk 8 using

sudo pacman -S jre8-openjdk

And put this line in your .bashrc or .zshrc

export JAVA_HOME=’/usr/lib/jvm/java-8-openjdk’
export PATH=$JAVA_HOME/bin:$PATH

Set permissions

Yay installs Flutters in /opt/flutter directory.Which can only be accessed using root user, so we need to set appropriate permissions. Execute these commands in your terminal.

 sudo groupadd flutterusers
sudo gpasswd -a $USER flutterusers
sudo chown -R :flutterusers /opt/flutter
sudo chmod -R g+w /opt/flutter/
sudo chown -R $USER:flutterusers /opt/flutter

If you get some weird permission denied errors try this

sudo chown -R $USER:flutterusers /opt/flutter

Installing Android SDK and tools

We are going to install android studio components that are actually required by flutter.

yay -S android-sdk android-sdk-platform-tools android-sdk-build-tools
yay -S android-platform

Meanwhile put this line in your .bashrc or .zshrc

export JAVA_OPTS=’-XX:+IgnoreUnrecognizedVMOptions’

User permissions
Again android-sdk is installed in /opt/android-sdk directory, So need to set appropriate permissions

sudo groupadd android-sdk
sudo gpasswd -a $USER android-sdk
sudo setfacl -R -m g:android-sdk:rwx /opt/android-sdk
sudo setfacl -d -m g:android-sdk:rwX /opt/android-sdk

Put these line in your .bashrc/.zshrc

export ANDROID_SDK_ROOT=’/opt/android-sdk’
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools/
export PATH=$PATH:$ANDROID_SDK_ROOTtools/bin/
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/
export CHROME_EXECUTABLE='/usr/bin/google-chrome-stable'

Restart your terminal and check everything is working properly by using these command

flutter doctor

Accept all of licences using

flutter doctor --android-licenses

Run flutter doctor again
if licences are not accepted, try these commands.

sudo chown -R $(whoami) $ANDROID_SDK_ROOT

if above command doesn’t work try

sudo flutter doctor --android-licenses

We are not going to install any android emulator because we will use physical device. This will certainly reduce load on your laptop. To use Physical device you need to enable USB debugging , you can follow these instructions to enable it.

--

--

Awais iqbal
0 Followers

Hi, I am a human who has fell in love with Flutter.