Krotox Engine › Docs › Krotox Manual › Build & Deploy

Building for Android (APK & AAB)

Everything between your scene and a game on a phone: the one-time toolchain setup, every Android field in Build Settings, signing for Google Play, choosing ABIs, pre-flight checks, Build and Run on a device, and what the exporter does for you.

Krotox builds Android games from File ▸ Build Settings… (Ctrl+Shift+B). One window covers everything: the scenes to include, the Android options, signing, the target device, and the Build and Build and Run buttons.

Before your first build

You need the Android tools installed once per computer:

Point the editor at them in the Project Hub ▸ Settings ▸ Android Toolchain card (or Settings ▸ Engine Settings with a project open). Each path shows a dot: green when found, red when the path does not exist, amber when blank (the editor then uses the matching environment variable). These paths are stored on your machine, not in the project.

The build uses Android Gradle Plugin 8.11.1 on Gradle 8.13, downloaded once into your user profile. On the first export, AGP installs the API 36 platform and build tools into your SDK, as long as the SDK licences have been accepted.

Step by step

  1. Open File ▸ Build Settings… and pick the Android platform.
  2. Add your scenes with Add Scene to Build... (or drag .ktx files in), and mark the first one with Set Start. Only listed scenes ship.
  3. Fill in the Android settings below. At least set the Package Name.
  4. Read the Pre-Flight Diagnostics card and fix anything red.
  5. Plug in a phone with USB debugging enabled (or start an emulator), press Refresh under Target Device and pick it.
  6. Press Build and Run to build, install and launch on the device, or Build to only produce the files. Open Output Folder shows the result.

Android settings

SettingWhat it does
Package NameYour app's unique ID in reverse-DNS form, such as com.studio.mygame. Google Play requires at least two segments. It cannot change once the game is published.
OrientationPortrait, Landscape or Auto-Rotate.
Minimum Android VersionThe oldest Android that can install the game, from API 24 (Android 7.0), the default, up to API 36. Raising it removes older devices from your Play listing.
Target Architecture (ABI)The CPU type to build for: arm64-v8a (modern phones), armeabi-v7a (older 32-bit phones), x86_64 and x86 (emulators and a few devices).
Universal BundleBuilds arm64-v8a, armeabi-v7a and x86_64 into one APK or App Bundle, so one file runs everywhere.
Package FormatAPK only (install directly, for testing), AAB only (Android App Bundle, what Google Play requires), or Both.
Build ConfigurationDebug for testing, Release for shipping.

Optimization & build options

OptionWhat it does
Force Rebuild Native Engine LibsRebuild the engine's native libraries instead of reusing the cached ones. Only needed if something looks stale.
R8 Code ShrinkingShrinks and strips unused Java code and resources.
Trim Managed AssembliesRemoves unused C# code before it is compiled ahead of time, for a smaller download.
Binary Scene CookingStores scenes in a binary format (.kbin) that loads faster than text.

Signing

Every Android app must be signed.

Back up your release keystore and its passwords somewhere safe. If you lose them you cannot publish updates to the same Play listing under the same signing key.

What the exporter does

When you press Build, Krotox:

  1. Compiles your C# scripts and compiles them ahead of time (Mono Full-AOT) to native ARM code. There is no just-in-time compiler on the phone, so no warm-up stalls.
  2. Compiles the engine's C++ for each selected ABI with the NDK, in a separate build tree per ABI, with size optimizations (-Os, dead-code removal and symbol stripping).
  3. Packs the listed scenes and every asset they use into a compressed data.pak.
  4. Writes the Android manifest and runs Gradle to produce a signed APK and/or AAB.
  5. For Build and Run, installs it over ADB and launches it.

On the device, the game reads data.pak straight from the APK's assets.

API levels and Android 16

App icon

A project with its own Application Logo uses it as the launcher icon. Without one, the export uses the default Krotox icon (the mascot's face) as an adaptive icon, scaled so a round launcher mask does not clip it.

Testing on a device

Common problems

ProblemFix
Pre-flight shows a red toolchain errorFix the SDK, NDK, JDK or ADB path in the toolchain settings and press Re-check.
Gradle fails on the first buildAccept the SDK licences (with the SDK manager), then build again.
Google Play rejects the uploadUpload an AAB signed with a custom release keystore, and use a package name with at least two segments.
The game installs but shows a black screenMake sure a start scene is marked in Build Settings and that it has a primary camera.
Old devices cannot find the game on PlayLower Minimum Android Version (API 24 reaches the most devices).
The APK is larger than expectedCheck File ▸ Build Report… for large assets, use VRAM-compressed textures for big images, and turn on R8 and assembly trimming.

Desktop builds are covered in Windows builds, resolution & scaling.