Dolphin for Android uses Gradle as the build system, which automatically invokes CMake to build native components. This guide covers building with both Android Studio and the command line.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dolphin-emu/dolphin/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Required Software
- Android Studio: Latest stable version
- Git: For cloning the repository
- Android SDK: Automatically installed by Android Studio
- Android NDK: Automatically installed by Android Studio
Android Studio will automatically download required SDK components and tooling when you open the project.
Platform Requirements
- Minimum Android Version: 5.0 Lollipop (API 21)
- Target Architectures: ARMv8 (ARM64) and x86-64
- Graphics: OpenGL ES 3.0 or higher required
Building with Android Studio
Source/Android directoryBuilding from Command Line
For automation or CI/CD, build from the command line using Gradle.git clone https://github.com/dolphin-emu/dolphin.git
cd dolphin
git submodule update --init --recursive
Build Variants
Debug Build
- Purpose: Development and testing
- Characteristics:
- Includes debug symbols
- No optimization (slower)
- Allows debugging with Android Studio
- Automatically signed with debug keystore
Release Build
- Purpose: Distribution and production
- Characteristics:
- Optimized for performance
- Smaller APK size
- Requires release keystore for signing
- ProGuard/R8 code shrinking enabled
Architecture Support
Dolphin for Android supports two architectures:ARM64 (ARMv8)
- Most Android devices (phones, tablets)
- Recommended for best compatibility
- Primary target architecture
x86-64
- Android emulators (Android Studio AVD)
- Some Intel/AMD-based Android devices
- Chromebooks with x86 processors
32-bit devices (ARMv7, x86) are not supported. Attempting to install on 32-bit devices will fail with an error.
Gradle Build System
How It Works
- Gradle manages Java/Kotlin code compilation
- Gradle automatically invokes CMake to build native C++ components
- CMake builds the Dolphin core libraries
- Gradle packages everything into an APK
Gradle Tasks
Common Gradle tasks:Code Style and Formatting
Dolphin maintains a consistent code style for Java and Kotlin.Import Code Style
Source/Android/code-style-java.xml from the repositoryFormat Before Committing
Before submitting changes:Run formatting after every edit to maintain consistency with the project.
Advanced Build Options
Custom CMake Arguments
Pass custom CMake arguments through Gradle:Building Specific ABIs
Build for specific architectures only:Parallel Builds
Speed up builds with parallel execution:Build Cache
Enable Gradle build cache:Signing Release Builds
Release builds require signing with a keystore.Create a Keystore
Configure Signing
Createkeystore.properties in Source/Android/:
Build Signed APK
Troubleshooting
SDK/NDK Not Found
Error: Android SDK or NDK not found Solution: Open the project in Android Studio and let it download required components automatically.Submodules Not Initialized
Error: Missing files from Externals Solution:CMake Build Failures
Error: Native build fails during Gradle execution Solution:- Ensure submodules are initialized
- Clean the build:
Out of Memory During Build
Error: Gradle daemon runs out of memory Solution: Increase heap size ingradle.properties:
APK Installation Failed
Error: Cannot install APK on device Solution:- Ensure device supports 64-bit apps (ARMv8 or x86-64)
- Check minimum Android version (5.0+)
- Verify USB debugging is enabled
- For release builds, ensure proper signing
Build Errors After Git Pull
Solution: Clean and rebuild:Running on Device or Emulator
Install Debug Build
Using Android Studio
- Connect your device or start an emulator
- Click the Run button (green triangle) in the toolbar
- Select your target device
- Android Studio will build, install, and launch the app
Building App Bundles
For Google Play distribution, build an Android App Bundle (AAB):Next Steps
After building:- APKs are in
Source/Android/app/build/outputs/apk/ - Install on device with
adb install <apk-file> - Or use Android Studio’s Run button for automatic installation
- Debug builds can be distributed directly for testing
- Release builds require signing for distribution
For contributing to the Android project, ensure you format code using the imported Dolphin code style before submitting pull requests.