Skip to main content
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.

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

Building from Command Line

For automation or CI/CD, build from the command line using Gradle.

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
Release builds require proper signing configuration. Unsigned release APKs cannot be installed.

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

  1. Gradle manages Java/Kotlin code compilation
  2. Gradle automatically invokes CMake to build native C++ components
  3. CMake builds the Dolphin core libraries
  4. 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

Format 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

Create keystore.properties in Source/Android/:
Never commit keystore.properties or keystore files to version control.

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:
  1. Ensure submodules are initialized
  2. Clean the build:

Out of Memory During Build

Error: Gradle daemon runs out of memory Solution: Increase heap size in gradle.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

  1. Connect your device or start an emulator
  2. Click the Run button (green triangle) in the toolbar
  3. Select your target device
  4. Android Studio will build, install, and launch the app

Building App Bundles

For Google Play distribution, build an Android App Bundle (AAB):
Output location:

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.