Installing Flutter on Arch: A Choose-Your-Own-Adventure Saga

SR
Serendeep Rudraraju
May 10, 20254 min read
Installing Flutter on Arch: A Choose-Your-Own-Adventure Saga

Let’s be real—installing Flutter on Arch Linux is like trying to assemble IKEA furniture with instructions written in ancient Greek. The internet is overflowing with guides, but most are either fossilized relics from 2019 or mysteriously don’t work because Flutter evolves faster than a caffeinated Pokémon.

If you’re using bash, you’ll find plenty of step-by-step resources. But if you’re a proud fish shell user? Good luck—most guides are so outdated, you’d think they were written on papyrus.

But fear not! Here are the three main ways to get Flutter up and running on Arch, ranked from “grandma-friendly” to “why am I doing this to myself?”:


The Three Paths to Flutter Enlightenment

  • The Easy Way:
    Download Android Studio and let it do the heavy lifting. For everything else, consult Stack Overflow and hope for the best. It’s like hiring movers instead of carrying the couch yourself.

  • The Weird Way:
    Install Flutter from the AUR. Prepare for a wild ride of dependency errors, cryptic logs, and the existential dread of “why doesn’t this work for me?” I never got this to work reliably, but maybe you’re luckier (or braver).

  • The Reliable Way (My Way):
    This is the method I trust—tried, tested, and works 10/10 times. If you want a setup that won’t break every time Flutter sneezes out a new update, read on.


Prerequisites: The Boring but Necessary Stuff

I roll with Java 21 because my apps like living on the edge with the latest Flutter and Gradle. Check the Gradle compatibility matrix if you’re feeling nerdy.

Install Java 21 from the AUR:

bash
yay -S jdk21-openjdk
archlinux-java set java-21-openjdk

No need to set JAVA_HOME—it’s as deprecated as Internet Explorer. Move along.


Getting Started: The Step-by-Step

Step 1: Download the Flutter SDK

Head to the official Flutter install page and grab the latest SDK.

Flutter suggests a ~/development folder, but I prefer ~/Android—it’s neater, and doubles as my ANDROID_HOME.

Extract the SDK like so:

bash
tar -xf ~/Downloads/flutter_linux_3.29.3-stable.tar.xz -C ~/Android/

Step 2: Command Line Tools—Because GUIs Are for Mortals

Download the Android command line tools.

Extract them into this oddly specific directory:

bash
mkdir -p ~/Android/cmdline-tools/latest
unzip ~/Downloads/commandlinetools-linux-*.zip -C ~/Android/cmdline-tools/latest

Yes, the directory structure is weird. No, I don’t make the rules.

Step 3: Set Up Your Shell Profile

For fish users (the cool kids):

fish
# Set the ANDROID_HOME environment variable
set -gx ANDROID_HOME "$HOME/Android"

# Add Android-related directories to the PATH
set -gx PATH "$ANDROID_HOME/flutter/bin" $PATH
set -gx PATH "$ANDROID_HOME/cmdline-tools/latest/bin" $PATH
set -gx PATH "$ANDROID_HOME/platform-tools" $PATH
set -gx PATH "$ANDROID_HOME/emulator" $PATH

For bash/zsh users (the classics):

bash
export ANDROID_HOME="$HOME/Android"
export PATH="$ANDROID_HOME/flutter/bin:$PATH"
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"
export PATH="$ANDROID_HOME/platform-tools:$PATH"
export PATH="$ANDROID_HOME/emulator:$PATH"

Pro tip: Make sure you’re not accidentally overwriting your $PATH—append/prepend as needed!

Step 4: Relaunch and Test

Restart your terminal so your shell can soak in those new variables.

Now, let’s get the Android licenses out of the way:

bash
yes | flutter doctor --android-licenses

Next, install the essential Android components (grab a coffee, this takes a while):

bash
yes | sdkmanager \
  "platform-tools" \
  "emulator" \
  "platforms;android-35" \
  "build-tools;35.0.0" \
  "system-images;android-35;google_apis_playstore;x86_64"

Once that’s done, run:

bash
flutter doctor -v

If something fails (usually build tools), don’t panic—Google and the Arch Wiki are your best friends.


Directory Structure: What You Should See

Your ~/Android folder should look something like this:

~/Android/
├── flutter/
├── cmdline-tools/
│   └── latest/
├── platform-tools/
├── emulator/
└── (other stuff)

Quality of Life Tweaks (a.k.a. “Save Your Sanity”)

Problem:
adb sometimes refuses to detect your device unless it’s in MTP mode. Annoying, right?

Solution:
Create a symbolic link so adb is always where it needs to be:

bash
sudo ln -s ~/Android/platform-tools/adb /usr/bin/adb

Now your phone should show up without needing to play USB mode roulette.


Final Thoughts

Setting up Flutter on Arch is a bit like assembling a spaceship from spare parts—frustrating, occasionally confusing, but oh-so-satisfying when it finally takes off. If you hit a snag, remember: you’re not alone, and there’s always another guide (or meme) out there to help.

Happy coding—and may your flutter doctor always return green checkmarks! 🚀🐧

Installing Flutter on Arch: A Choose-Your-Own-Adventure Saga | The Prompt & The Ponder