Skip to content

Instantly share code, notes, and snippets.

@AlifiChiganjati
Created January 14, 2025 10:27
Show Gist options
  • Save AlifiChiganjati/54e456afa878c17eeb95700dc30413b1 to your computer and use it in GitHub Desktop.
Save AlifiChiganjati/54e456afa878c17eeb95700dc30413b1 to your computer and use it in GitHub Desktop.
Flutter for Void Linux or any distro

It's for Void Linux but I think work for any distro

Install openjdk

  • Install package
doas xbps-install openjdk openjdk17
  • change java version
doas xbps-alternatives -s openjdk17

Install Flutter SDK

  • after extract tar flutter move in /opt/flutter
doas mv ~/Downloads/flutter /opt
  • make group
doas groupadd flutter
doas gpasswd -a $USER flutter
doas chown -R :flutter /opt/flutter
doas chmod -R g+w /opt/flutter/

Install Android SDK

  • make folder for android-sdk
doas mkdir /opt/android-sdk/cmdline-tools/ -p
  • after that move cmdline-tools folder to /opt/android-sdk/cmdline-tools/latest/
doas mv ~/Downloads/cmdline-tools /opt/android-sdk/cmdline-tools/latest/
doas groupadd android-sdk
doas gpasswd -a $USER android-sdk
doas setfacl -R -m g:android-sdk:rwx /opt/android-sdk
doas setfacl -d -m g:android-sdk:rwX /opt/android-sdk

note: if command setfact not found install package acl, acl-devel, acl-progs

Add PATH in .bashrc or .bash_profile

# flutter
export FLUTTER_ROOT="/opt/flutter/"
export PATH="$FLUTTER_ROOT/bin:$PATH"
export CHROME_EXECUTABLE=/usr/bin/firefox

# android-sdk
export ANDROID_SDK_ROOT='/opt/android-sdk'
export PATH="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$PATH"
export PATH="$ANDROID_SDK_ROOT/platform-tools:$PATH"
export PATH="$ANDROID_ROOT/emulator:$PATH"
  • next update your PATH
source ~/.bash_profile
  • sdkmanager
sdkmanager --list
  • install android
sdkmanager --install "system-images;android-29;default;x86"
sdkmanager --install "platforms;android-29"
sdkmanager --install “platform-tools”
sdkmanager --install "build-tools;29.0.3"
sdkmanager --install "cmdline-tools;latest"
sdkmanager --licenses

If need

sdkmanager --sdk_root=/opt/android-sdk/cmdline-tools/latest

LAST STEP

flutter config --android-sdk /opt/android-sdk/
  • add android licenses
flutter doctor --android-licenses

check if got error

flutter doctor -v

Source

Setup flutter environment in arch linux
Install Flutter Without Android Studio on Linux 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment