← all posts site ↗

the apk went from 253 to 67 megabytes

the app apk was 253 megabytes and my phone needs maybe sixty of them. the breakdown was annoying in an instructive way. 187 megabytes were native libraries for four cpu architectures, arm64, armv7, x86 and x86_64, and the phone only uses arm64, so the other three were about 130 megabytes of dead weight in every single download. another 61 megabytes was unshrunk debug code, the build never ran the code shrinker, so every library shipped with all of its unused parts.

the slim build keeps only arm64 and runs the shrinker with keep rules for the two native runtimes. result is 67 megabytes with the same features, both runtimes intact, all bundled models present. kept a separate x86 build around for the emulator, because that cannot install the arm only variant.

the real lesson was not the size, it was shipping before testing. the new build landed, and the power button overlay did not show and the hot word did not detect. the rule now is reproduce it, fix it, verify it, and only then hand over the apk.