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 updateInstall wget and snapd which are required for downloading files and managing snaps respectively.
sudo apt install wget -y
sudo apt install -y snapdInstall OpenJDK 17 which is required for Flutter development.
sudo apt install openjdk-17-jdkVerify JDK installation:
java -versionDownload 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_PATHUpdate 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" >> ~/.bashrcSource .bashrc to apply the changes:
source ~/.bashrcInstall Flutter using Snap package manager and run flutter doctor to verify the installation.
sudo snap install flutter --classic
flutter doctorAfter 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! 🚀