Android APK is very large

392 views
Skip to first unread message

Dean Wedel

unread,
Jul 22, 2024, 2:40:09 PMJul 22
to Chromium-dev
I can successfully create an APK. However it winds up being really large which the Play-Store complains about when submitted. I get this size of output:
> 258941669 Jul 22 11:24 ChromePublic.apk

I'm using these GN settings:
target_os = "android"
target_cpu = "arm64"
is_debug=false
is_java_debug = false
symbol_level = 0
treat_warnings_as_errors = false
is_official_build=true
chrome_pgo_phase = 0


I'm building with this command:
$ autoninja -C out/Default chrome_public_apk -j 10

What can I change to end up with a smaller APK ? I think the Play-Store wants a maximum of 100MB. . .

Andrew Grieve

unread,
Jul 22, 2024, 3:18:57 PMJul 22
to dean....@gmail.com, Chromium-dev
Those args look correct to me. I think the play store limit is higher for .aab files.

--
--
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/e7731f2e-ba2a-4d25-b817-a4d90b29bd9en%40chromium.org.

Dean Wedel

unread,
Jul 22, 2024, 3:38:45 PMJul 22
to Chromium-dev, Andrew Grieve, Chromium-dev, dean....@gmail.com
Thanks for that input. I'll try build for chrome_public_bundle instead and see what happens.

Dean Wedel

unread,
Aug 29, 2024, 10:02:09 AMAug 29
to Chromium-dev, Dean Wedel, Andrew Grieve, Chromium-dev
When I build with this command-line:
> autoninja -C out/Default chrome_public_bundle -j 10

And submit the generated AAB to the PlayStore they complain that the Bundle is "unsigned".  When I generate an APK it is automatically signed if I have the setting "is_official_build=true".
Is there something different that I need to do for signing an AAB ?

Mohamed Heikal

unread,
Aug 29, 2024, 11:03:54 AMAug 29
to dean....@gmail.com, Chromium-dev, Andrew Grieve
I believe playstore needs you to sign it with your upload key, you can use jarsigner to sign the bundle (see docs). You can generate a key using keytool (or Android Studio) if you don't already have one. I think you also need to let playstore know about the upload key but I am not sure about that one.

Dean Wedel

unread,
Aug 29, 2024, 11:11:53 AMAug 29
to Chromium-dev, Mohamed Heikal, Chromium-dev, Andrew Grieve, dean....@gmail.com
Thanks for that advice! I have a good signing-key that has worked for all of the APKs that I've uploaded. This is my first round with dealing with an AAB so trying to stumble my way through the hurdles.

Dean Wedel

unread,
Aug 29, 2024, 11:44:34 AMAug 29
to Chromium-dev, Dean Wedel, Mohamed Heikal, Chromium-dev, Andrew Grieve
Another question with my "signing-bundle" problem:
In looking in the "GN" document (https://github.com/webrtc-uwp/chromium-build/blob/master/config/android/rules.gni) I see there is an item "sign_bundle" at line 4220. Does anyone know how this works? Do I just add "sign_bundle = true" to my args.gn file and the autoninja will do the signing??

Just for clarification when I generate an APK then it does get automatically signed with my keystore. So that part works. I'm just trying to get an AAB to be signed by ninja if possible.

Mohamed Heikal

unread,
Aug 29, 2024, 11:50:36 AMAug 29
to Dean Wedel, Chromium-dev, Mohamed Heikal, Andrew Grieve
There is no support for ninja to sign bundles for you. It does sign the actual apks if you try to install the bundle using the helpers under "out/Directory/bin/<target_name>" for local development but signing the actual bundle is only needed as part of the upload to playstore and is not needed for local development so there are no gn/ninja code/args to do it for you.

Dean Wedel

unread,
Aug 29, 2024, 11:57:48 AMAug 29
to Chromium-dev, Mohamed Heikal, Chromium-dev, Andrew Grieve, Dean Wedel
Thanks again for that advice! Much appreciated.
Reply all
Reply to author
Forward
0 new messages