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
Method 1: Install via Android Studio (recommended)
This is the easiest method and recommended for most developers.Open Android Studio
Launch Android Studio. If you don’t have it installed, download it from developer.android.com.
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).
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)
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.
Method 2: Install standalone NDK
You can download the NDK as a standalone package without Android Studio.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.dmgor.zip - Windows:
android-ndk-r<version>-windows.zip
Check the NDK wiki for the latest stable and preview versions.
Method 3: Install via command line (SDK Manager)
If you have the Android SDK command-line tools, you can install the NDK using sdkmanager.Platform-specific considerations
Linux
-
Ensure you have the required 32-bit libraries if you’re on a 64-bit system:
- 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:
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:- Go to File > Project Structure > SDK Location
- 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:
Permission denied errors
On Linux/macOS, if you encounter permission issues: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.