Skip to main content

Android

Prerequisites​

  • Android Studio, with Android SDK Platform 36, NDK 28.2.13676358, and CMake 3.31.5 installed through SDK Manager.
  • JDK 17 (Android Studio's bundled JBR is suitable).
  • Git, with the repository's submodules initialized.
Version requirements

The Android app configures SDK Platform 36, NDK 28.2.13676358, and CMake 3.31.5. The root CMakeLists.txt also requires CMake 3.31 or newer. These differ from older Android instructions mentioning NDK 27+ and CMake 3.22.1; use the versions configured by the current project.

Build with Android Studio​

  1. Open src/android in Android Studio and allow Gradle sync to finish.
  2. In Build > Select Build Variant, choose a flavor and build type from the table below.
  3. Select Build > Make Project, or run the app configuration on a connected Android device.

Build from the terminal​

From the repository root, set the SDK and NDK locations if they are not already configured in Android Studio:

export ANDROID_SDK_ROOT=/path/to/android/sdk
export ANDROID_NDK_ROOT=/path/to/android/sdk/ndk/28.2.13676358

Run a Gradle task from src/android. For example:

cd src/android
./gradlew assembleMainlineRelWithDebInfo

Use assemble<Flavor><BuildType> for another combination (for example, assembleGenshinSpoofRelWithDebInfo). To pass additional arguments to CMake, set the Gradle project property YUZU_ANDROID_ARGS, for example:

./gradlew assembleMainlineRelWithDebInfo -PYUZU_ANDROID_ARGS="-DENABLE_DEBUG_TOOLS=ON"

The APK is written under app/build/outputs/apk/<flavor>/<buildType>/. Bundle tasks (bundle<Flavor><BuildType>) write AABs under app/build/outputs/bundle/<flavor><buildType>/. The generated copy<Flavor><BuildType>Outputs task copies both artifacts, when built, into the repository's artifacts/ directory.

Package name and compiler cache​

-PappId builds the same sources under another application ID, which is how CI produces the published package name:

./gradlew --no-daemon -PappId=dev.eglantine.eglantine_emulator \
-PYUZU_ANDROID_ARGS=-DUSE_CCACHE=ON assembleMainlineRelease

-Pnightly=true marks the build as a nightly, adding the .nightly package suffix and the Nightly name suffix. GIT_TAG_NAME sets the versionName; without it Gradle asks git, which a shallow checkout answers with a bare commit hash.

-DUSE_CCACHE=ON puts ccache in front of every C and C++ compile. Install it first (sudo apt install ccache): configure stops with an error when the option is on and no ccache is on PATH. Gradle and ccache caches both survive between builds, so a rebuild after changing only Java or Kotlin code skips the native compile.

Continuous integration​

build-android builds the arm64 release APK on ubuntu-24.04, with the same identity files, CPM cache, and compiler cache as the desktop jobs, and uploads it as eglantine-android-arm64-<sha>. ci runs it alongside the other platforms and release publishes the APK, so a tag, branch, or daily build produces an installable APK without a local toolchain. See CI.

Build variants​

The Android Gradle project combines one product flavor with one build type. All listed flavors target arm64-v8a except ChromeOS, which targets x86_64.

FlavorApp variantMinimum Android SDKPurpose
mainlineEglantine33Standard build
genshinSpoofEglantine Optimized35Genshin Spoof build
legacyEglantine Legacy29Compatibility patches for older GPUs
chromeOSEglantine ChromeOS24 (default)ChromeOS x86_64 build
Build typeGradle suffixDescription
debugDebugDebuggable build
relWithDebInfoRelWithDebInfoDebuggable release-style build with JNI debugging
releaseReleaseMinified, non-debuggable build; uses the configured release keystore when available, otherwise the default debug key
ChromeOS task names

The Gradle flavor is named chromeOS; use that spelling in task names, such as assembleChromeOSRelWithDebInfo.