Now that the generator installs the Zig runtime into
app/src/main/jniLibs/<abi>/libcraft.so, every generated app's APK carries it
— and at -Doptimize=ReleaseSafe each library is built with debug info:
5,761,056 zig-out/android/arm64-v8a/libcraft.so
5,565,632 zig-out/android/x86_64/libcraft.sofile reports "with debug_info, not stripped" for both, so a universal APK
ships roughly 11 MB of native library, most of it DWARF.
AGP would normally strip native libraries at packaging time, but its
stripDebugSymbols task shells out to the NDK's strip, and the generated
project configures no NDK — the JNI library deliberately needs none to build
(android_dispatch.zig:77-89 explains why it links no libc). So the strip step
has nothing to run and the symbols ship.
Worth measuring before choosing:
- What a stripped library actually costs —
-Dstripon the two JNI artifacts inbuild.zig:2428-2467, or.strip = trueon those modules for release builds only. - Whether keeping debug info is worth it. Nothing currently symbolicates a native crash from a generated app; there is no upload step and no symbol store, so today the DWARF is paid for and unused.
- Whether ABI splits belong here — most apps do not need both architectures in
one artifact, and
splits { abi { … } }is a one-block change tobuild.gradle.kts.app.template.
Not urgent: correctness came first and the runtime now genuinely loads and binds. But it is a cost every generated app pays from the commit that shipped it, so it should not go unmeasured for long.
Found while implementing #200.