Menu

I diffed my Capacitor APK against my web build. 780 files inside it no longer existed.
πŸ“°

I diffed my Capacitor APK against my web build. 780 files inside it no longer existed.

DEV Community: capacitorΒ·Melisa WongΒ·about 9 hours ago
#7fbtTU57
#devtocapacitor#devto#dev#build#assets
Reading 0:00
15s threshold

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.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.