I signed a release APK that was 585 MB . The web build it was supposed to contain is 182.7 MB . Compression does not explain a 3.5Γ gap, so I went looking β and what I found was worse than a size problem: 780 of the 1,397 files inside that APK no longer existed anywhere in my project.
Here is how the gap was made, how to spot it in about three seconds on your own app, and the guard script I now run before every signing.
The first guess was wrong in an instructive way
My instinct was "images are heavy". I listed the largest files inside the native project's copy of the web bundle:
ls -l android/app/src/main/assets/public/assets/ * .js
Enter fullscreen mode
Exit fullscreen mode
69240126 Exploration-BM48lXvB.js 11977882 surname_info-BqOd4Hrh.js 369001 index-DjfizeWu.js 290721 pinyin_to_script-DzUio84d.js
Enter fullscreen mode
Exit fullscreen mode
A 69 MB chunk called Exploration . That is a real problem, but not the one I was hunting, because those filenames do not exist in dist/ at all.β¦