This repository provides a script to set up Flutter development environment on Linux without using Android Studio. This can be useful if you prefer to manage your Flutter projects without the overhead of Android Studio or if you're facing issues with Android Studio on your system.
- Linux operating system (tested on Ubuntu)
- Internet connection
Follow these steps to set up Flutter on your Linux system:
sudo apt update
Install wget
and snapd
which are required for downloading files and managing snaps respectively.
sudo apt install wget -y
sudo apt install -y snapd
Install OpenJDK 17 which is required for Flutter development.
sudo apt install openjdk-17-jdk
Verify JDK installation:
java -version
Download the Android Command Line Tools and set up the environment variables.
ANDROID_SDK_PATH="$HOME/Android"
mkdir -p $ANDROID_SDK_PATH
wget https://github.com/1xrohit/Setup-ReactNative-on-Ubuntu-without-Android-Studio/releases/download/AndroidSDK/Android.zip -O $ANDROID_SDK_PATH/Android.zip
unzip $ANDROID_SDK_PATH/Android.zip -d $ANDROID_SDK_PATH
Update PATH in .bashrc
:
echo "export ANDROID_HOME=$ANDROID_SDK_PATH/Sdk" >> ~/.bashrc
echo "export PATH=\$PATH:\$ANDROID_HOME/emulator" >> ~/.bashrc
echo "export PATH=\$PATH:\$ANDROID_HOME/platform-tools" >> ~/.bashrc
echo "export PATH=\$PATH:\$ANDROID_HOME/cmdline-tools/latest/bin" >> ~/.bashrc
echo "export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64" >> ~/.bashrc
echo "export PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
Source .bashrc
to apply the changes:
source ~/.bashrc
Install Flutter using Snap package manager and run flutter doctor
to verify the installation.
sudo snap install flutter --classic
flutter doctor
After completing the setup, you can start developing Flutter applications without using Android Studio. You can create new projects, run and debug applications directly from the command line using Flutter CLI tools.
I hope you've found this guide helpful
Follow me on Twitter for more tips. Happy Fluttering! 🚀