Skip to main content

Install Android NDK

This guide walks you through installing the Android NDK on your development machine. You can install the NDK through Android Studio (recommended) or as a standalone download.
Before installing the NDK, ensure you have the latest version. Check the NDK downloads page for the latest stable and preview releases.

Prerequisites

Before installing the NDK, you need:
  • Android Studio (recommended) or Android SDK command-line tools
  • Java Development Kit (JDK) version 8 or higher
  • At least 5 GB of free disk space for the NDK and build tools
  • A supported operating system: Linux, macOS, or Windows
While you can use the NDK for app development on Windows, building the NDK itself from source is only supported on Linux and macOS.
This is the easiest method and recommended for most developers.
1

Open Android Studio

Launch Android Studio. If you don’t have it installed, download it from developer.android.com.
2

Open SDK Manager

Navigate to Tools > SDK Manager from the menu bar.Alternatively, click the SDK Manager icon in the toolbar or go to File > Settings > Appearance & Behavior > System Settings > Android SDK (on Windows/Linux) or Android Studio > Preferences > Appearance & Behavior > System Settings > Android SDK (on macOS).
3

Navigate to SDK Tools tab

In the SDK Manager window, click on the SDK Tools tab.
4

Select NDK and CMake

Check the following items:
  • NDK (Side by side) - This installs the NDK
  • CMake - Build system for native code (recommended)
  • LLDB - Debugger for native code (recommended)
The “Side by side” option allows you to install multiple NDK versions simultaneously.
5

Apply and install

Click Apply or OK to begin the installation. Android Studio will download and install the selected components.The installation may take several minutes depending on your internet connection.
6

Verify installation

After installation completes, you can find the NDK at:
~/Android/Sdk/ndk/<version>
# or
~/Library/Android/sdk/ndk/<version>  # macOS

Method 2: Install standalone NDK

You can download the NDK as a standalone package without Android Studio.
1

Download the NDK

Visit the NDK downloads page and download the appropriate package for your operating system:
  • Linux: android-ndk-r<version>-linux.zip
  • macOS: android-ndk-r<version>-darwin.dmg or .zip
  • Windows: android-ndk-r<version>-windows.zip
Check the NDK wiki for the latest stable and preview versions.
2

Extract the archive

Extract the downloaded archive to a location of your choice:
unzip android-ndk-r<version>-linux.zip -d ~/android-ndk
3

Set environment variables

Add the NDK to your system PATH for easier access:
# Add to ~/.bashrc or ~/.bash_profile
export ANDROID_NDK_HOME=~/android-ndk/android-ndk-r<version>
export PATH=$PATH:$ANDROID_NDK_HOME
4

Verify the installation

Open a new terminal and verify the NDK is accessible:
ndk-build --version
# Or check the directory:
ls $ANDROID_NDK_HOME
You should see version information and NDK files.

Method 3: Install via command line (SDK Manager)

If you have the Android SDK command-line tools, you can install the NDK using sdkmanager.
1

List available NDK versions

sdkmanager --list | grep ndk
This shows all available NDK versions.
2

Install the NDK

Install a specific NDK version:
sdkmanager --install "ndk;<version>"
For example:
sdkmanager --install "ndk;25.2.9519653"
Or install the latest version:
sdkmanager --install "ndk-bundle"
3

Verify installation

sdkmanager --list_installed | grep ndk

Platform-specific considerations

Linux

  • Ensure you have the required 32-bit libraries if you’re on a 64-bit system:
    sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1
    
  • Some distributions may require additional dependencies. Check the NDK documentation for your specific distribution.

macOS

  • macOS 10.14 (Mojave) or later is required for recent NDK versions
  • Xcode Command Line Tools must be installed:
    xcode-select --install
    

Windows

  • Windows 7 or later (64-bit) is required
  • The NDK works with both Command Prompt and PowerShell
  • Consider using Windows Subsystem for Linux (WSL) for a Linux-like development experience

Troubleshooting

NDK not found in Android Studio

If Android Studio doesn’t detect your NDK:
  1. Go to File > Project Structure > SDK Location
  2. Set the Android NDK location manually to your NDK installation directory

Multiple NDK versions

Android Studio’s “side by side” installation allows multiple NDK versions:
  • Versions are installed in separate directories: ndk/<version>/
  • Configure which version to use in your project’s build.gradle:
android {
    ndkVersion "25.2.9519653"
}

Permission denied errors

On Linux/macOS, if you encounter permission issues:
chmod -R +x ~/Android/Sdk/ndk/<version>

Next steps

Now that you have the NDK installed, you’re ready to build native Android applications. Continue to the quick start guide to create your first native app.
Keep your NDK updated by regularly checking for new versions through the SDK Manager or the NDK downloads page.

Build docs developers (and LLMs) love