Reduce Android APK size

475 views
Skip to first unread message

Philby Dias

unread,
Oct 15, 2024, 7:13:40 AM10/15/24
to Chromium-dev

Hello,

Since we upgraded from 114 to 126, I noticed the size of APK generated has increased. 
Upon analysing further, it seems libchrome has gone up from around 50MB to 80MB so I was curious if there is any way for me to reduce the size of APK/libchrome? We might not be able to upload to playstore after including our resources.

Thanks in advance, appreciate any help with this.

Philby

Andrew Grieve

unread,
Oct 15, 2024, 9:53:42 AM10/15/24
to philbyalo...@rakuten.com, Chromium-dev
The main knob that exists for size is `optimize_for_size`, so you could try setting that.

I'd recommend switching to .aab files for Play Store upload though. The limit of those is much higher.


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/ef7bc2c5-694d-4064-aefc-30b0ec40d381n%40chromium.org.

uazo

unread,
Oct 15, 2024, 11:08:37 AM10/15/24
to Chromium-dev, Andrew Grieve, Chromium-dev, philbyalo...@rakuten.com
you can always force compression in apks.

see https://github.com/uazo/cromite/blob/master/build/patches/Compress-libchrome-to-free-up-some-space.patch

Obviously the disk space once installed doubles because it will contain both zipped and unzipped .so.
the advantage of using aabs is that the resources are also zipped, whereas in apks the support has been removed.

Pradeep H

unread,
Oct 15, 2024, 10:13:47 PM10/15/24
to Chromium-dev, uazo, Andrew Grieve, Chromium-dev, philbyalo...@rakuten.com
Hi ,

One more clarification. In case of apks we currently build all architecture apks like arm7,arm64,x86,x64 and upload 4 apks to Play Store.
In aab also do we need to follow same procedure ?
Also currently we sign the apk with our own key and upload but if we use aab it would be play store signed will that work with same key as we need to update our app.
Reply all
Reply to author
Forward
0 new messages