Skip to content
Source

16kb Page Sizes

Maybe everyone in Android has been bugged with this topic already, but I'm about the same thing. If you happen to be related to some Android app, and you don't care about what happens after November 1st, then read here. In short, native libs must support this thing - they need to be recompiled. And we, accordingly, need to update to these updated versions. Otherwise, it will be impossible to publish an update to Google Play.

If only it were that simple. We have everything bad.

First, there are a couple of internal libraries for scanning documents and people's faces. In my experience, roughly the most typical reason to drag something native into an Android project (after some maps or neural networks). Well, they don't meet these requirements. Naturally, you can't find the ends of who wrote all this. And if you still found them, you get an answer that they have a new version 2.0. And, naturally, for which on our side we need to rewrite everything. This is classic, there's nothing even to talk about here. We'll have to work.

But the second source of quirks for us is quite unexpected - it's Flutter. And this isn't even so much a 16kb problem as collateral damage. The Flutter engine is the same native lib. It's transitively dragged to us by a neighboring product's library, and on our side we know almost nothing about it. Accordingly, nothing foreboded trouble.

And on the next regression, we notice that the app now weighs not 35mb at its peak, but 75mb. Further investigations generally show us that debug builds flew far beyond 400mb instead of the original 80mb. And developers drive these builds to devices over WiFi, by the way. This is wow.

As far as I understand now (and I don't understand anything in these Flutters), that neighboring team was sitting on an old version of Flutter, and now they decided to update because 16kb is not far off. They updated not to the version where this support just appeared, but immediately to the latest. And it would be boring if this latest Flutter version turned out without problems. And these problems in turn seem to grow from some AGP and NDK problem. And this problem is not yet solved and workarounds on our side don't help yet. Something extra isn't getting cut out of the final build now that was cut out before.

In this specific case, we had to roll back to lower versions. In the hope that someday they'll fix it.

This story once again confirms how fragile everything is. Peace is only in our dreams, we're in an infinite loop: new requirements → new updates → new fixes → new bugs.

Conclusions:

  1. It's time to go and plug in app size calculation for users in CI right on merge requests if you don't have it yet.
  2. Updating many versions forward at once is painful, avoid it.
  3. Don't postpone such tasks where you need to adjust to some requirements in time. So much interesting stuff can come out that it's better if you had a time buffer for this.
  4. Don't touch Flutter if possible (joke, but maybe not)