If you are a Linux user like me and prefer lightweight tools like VS Code over Android Studio, setting up Flutter and the Android SDK can be challenging. As a part-time developer at an ISP, I've faced this process recently on Fedora after reinstalling my PC. Here is a detailed guide to help you get Flutter up and running without the bloat.
Prerequisites
- Linux distribution (tested on Fedora and Arch)
- Basic knowledge of bash scripting
Step 1: Install JDK
Flutter and the Android SDK require a Java Development Kit (JDK). It is possible to use a JDK version installed using a package manager of your distribution, but I recommend downloading Eclipse Temurin JDK and using it as a local user installation.
You will have to find a JDK version, that is compatible with your Android SDK platform version. I was unable to find a proper compatibility table, but there is a bit of information in the Android docs.
Steps:
-
Extract the downloaded files and move them to a permanent location, such as
~/.local/share/jdk
. -
Update your
.bashrc
file: -
Reload your shell:
Step 2: Install Android SDK Command-Line Tools
Instead of installing Android Studio, download the Command-Line Tools.
Steps:
-
Extract the tools and move them to
~/.local/share/android-sdk/cmdline-tools/latest
(ensure thebin/
inside directory is correctly placed). -
Update your
.bashrc
file: -
Reload your shell:
-
Use the SDK manager to install essential components:
You can change the version of the components to the one you need. Also keep in mind, that Flutter can later install other components during builds.
Step 3: Install Flutter SDK
Download the Flutter SDK from the official website.
Steps:
-
Extract the downloaded SDK to a directory like
~/.local/share/flutter
. -
Update your
.bashrc
file: -
Reload your shell:
Step 4: Verify Your Installation
-
Check if Flutter and the Android SDK are correctly set up:
-
Ensure that all dependencies are resolved.
Tips for Development
- Use VS Code with the Flutter extension for a lightweight and efficient setup.
- Regularly update your tools using
flutter upgrade
andsdkmanager
commands.
By following these steps, you can avoid the bloat of Android Studio and enjoy a streamlined development environment. If you encounter issues, feel free to comment or reach out!