Tip
Most users should use valdi dev_setup instead! This guide is a reference for manual installation or troubleshooting. The valdi dev_setup command automatically handles all of these steps.
This guide documents the dependencies Valdi needs on Linux and how to install them manually. For the quickest setup, use valdi dev_setup which automates all of these steps.
This guide assumes you're using the default shell (bash). Setup is possible for other shells, but you'll need to adapt the configuration file paths.
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
apt-get install npm openjdk-17-jdk git-lfs libfontconfig1-dev
Watchman is available via apt-get and will be installed with other dependencies.
Note
valdi dev_setup installs Bazelisk automatically. It downloads the bazelisk binary to ~/.valdi/bin/ and adds it to your PATH.
For manual installation, follow the Bazelisk installation guide or install via npm:
npm install -g @bazel/bazeliskGit Large File Storage (LFS) manages the binaries that we need for Valdi.
git lfs install
Note
valdi dev_setup installs Android SDK command-line tools automatically. You only need Android Studio if you prefer using its GUI or need Android emulator management.
Run valdi dev_setup - it will download and install Android SDK command-line tools, including:
- Platform tools (API level 35)
- Build tools (version 34.0.0)
- NDK (version 25.2.9519653)
If you prefer using Android Studio's GUI:
- Download and install Android Studio from developer.android.com/studio
- Open any project, navigate to
Tools->SDK Manager - Under SDK Platforms, install API level 35
- Under SDK Tools, uncheck
Hide obsolete packages, checkShow Package Details - Install build tools version 34.0.0
- Install NDK version 25.2.9519653
Add the following to your .bashrc
echo "export ANDROID_HOME=$HOME/Android/Sdk" >> ~/.bashrc
echo "export ANDROID_NDK_HOME=\$ANDROID_HOME/ndk-bundle" >> ~/.bashrc
echo "export PATH=\$ANDROID_HOME/platform-tools:\$PATH" >> ~/.bashrc
source ~/.bashrc
Bazel eats a lot of memory, if you see Java memory errors, you don't have enough swap space.
8GB should be enough for an Android build of the hello world app.