Android APK is very large

481 views
Skip to first unread message

Dean Wedel

unread,
Jul 22, 2024, 2:40:09 PM7/22/24
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 PM7/22/24
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 PM7/22/24
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 AM8/29/24
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 AM8/29/24
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 AM8/29/24
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 AM8/29/24
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 AM8/29/24
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 AM8/29/24
to Chromium-dev, Mohamed Heikal, Chromium-dev, Andrew Grieve, Dean Wedel
Thanks again for that advice! Much appreciated.

Tianyi Song

unread,
Nov 5, 2025, 11:25:49 AM (yesterday) Nov 5
to Chromium-dev, Mohamed Heikal, Chromium-dev, Andrew Grieve, Dean Wedel
Hi Mohanmed,
I am working on signing the app bundle and got some confusion. As I saw in this thread Create unsigned App Bundle for AndroidTorne (Richard Coles) mentioned to

Use the GN args `android_keystore_path` `android_keystore_name` and `android_keystore_password` to specify the keystore and key you want to use for signing. If you're using Play's signing you can just set this to your upload key; if you're signing it yourself you would set it to your release key when you want to do a release build.

I tried to add android_keystore_path in args.gn but the generated aab is not signed. And you mentioned that There is no support for ninja to sign bundles for you. 
So I hope to confirm if you know whether the args mentioned above  is only for some certain cases, which means we still have to sign ourselves if we want to upload the aab to play store?

Thank you!

Torne (Richard Coles)

unread,
Nov 5, 2025, 11:38:08 AM (yesterday) Nov 5
to tiany...@rakuten.com, Chromium-dev, Mohamed Heikal, Andrew Grieve, Dean Wedel
On Wed, 5 Nov 2025 at 11:23, 'Tianyi Song' via Chromium-dev <chromi...@chromium.org> wrote:
Hi Mohanmed,
I am working on signing the app bundle and got some confusion. As I saw in this thread Create unsigned App Bundle for AndroidTorne (Richard Coles) mentioned to

Use the GN args `android_keystore_path` `android_keystore_name` and `android_keystore_password` to specify the keystore and key you want to use for signing. If you're using Play's signing you can just set this to your upload key; if you're signing it yourself you would set it to your release key when you want to do a release build.

I tried to add android_keystore_path in args.gn but the generated aab is not signed. And you mentioned that There is no support for ninja to sign bundles for you. 
So I hope to confirm if you know whether the args mentioned above  is only for some certain cases, which means we still have to sign ourselves if we want to upload the aab to play store?

The GN args only configure which key to use when signing is applied - they don't affect which things get signed. When building an APK (not a bundle), the specified key is used to sign the APK. When installing a bundle locally for development using the generated wrapper scripts, the APKs that get generated for the install are also signed with the specified key. But, as Mohammed said, we just haven't implemented any step in our build system that signs the bundle itself because it's not necessary for development purposes.

The official Google release builds for Chrome and WebView are signed separately after the build has finished. The tools used to do this aren't public and would not be useful to you, as they're specific to Google's internal signing infrastructure.
 

Tianyi Song

unread,
6:04 AM (12 hours ago) 6:04 AM
to Chromium-dev, Torne (Richard Coles), Chromium-dev, Mohamed Heikal, Andrew Grieve, Dean Wedel, tiany...@rakuten.com
Hi Torne,
Thank you for your confirmation!! (I have removed my duplicate reply in the other post)

Reply all
Reply to author
Forward
0 new messages