Android without Gradle
The default Android design is a direct build-system integration. The user project contains no build.gradle, Gradle wrapper, Android Studio project, Java source, or Kotlin source.
Pipeline
- Load Cargo metadata and strict
ferry.toml. - Discover one coherent SDK platform, Build Tools revision, NDK LLVM toolchain, Java toolchain, and configured Rust targets.
- Cross-compile the Rust
cdylibfor each ABI. Cargo JSON identifies the exact native artifact and constrained build-script output directories. - Generate a deterministic manifest, resources, and NativeActivity metadata below
target/ferry/android/. - Compile and link resources with
aapt2against the selectedandroid.jar. - Collect required dependency DEX, and compile/merge generated JVM bridge code with
javacandd8only when needed. - Insert uncompressed native libraries under
lib/<abi>/and sequentialclasses*.dexentries. - Run
zipalignbefore signing, then sign withapksigner. - Verify signature, 16 KiB native-library alignment, package/launcher metadata, safe/unique ZIP entries, resources, DEX headers, and ELF ABI headers.
AAPT2’s linked APK is incomplete by itself: it lacks the Rust library, dependency DEX, and signature. Generated strings or an unsigned intermediate must never be reported as the final artifact.
Slint consequence
Slint’s Android integration may produce an internal Java helper/DEX from a Cargo build script. The packager therefore consumes Cargo JSON output and merges constrained DEX inputs. If DEX exists, the manifest must not declare android:hasCode="false".
Signing
Debug signing material belongs in cargo-ferry’s machine configuration directory, not in an application repository. Release signing is explicit. Password sources must be redacted and should avoid process arguments when the selected tool permits safer input.
Build versus deployment
build needs no ADB, emulator, USB connection, or phone and never installs or launches. The explicit install android and run android commands now compose a fresh, independently validated APK with typed ADB operations for one exact device ID, or for the sole compatible device when selection is unambiguous. logs android collects a bounded application-filtered snapshot by default; --json-stream selects the live protocol stream.
Those deployment paths are implemented and host-tested, but no emulator or physical Android device was available for runtime validation. Artifact status and device status remain independent in the Support matrix.
See ADR-002, Android build, and the official AAPT2, zipalign, apksigner, and NDK custom build-system documentation.