How to build a smaller system_webview_apk.

645 views
Skip to first unread message

pc wei

unread,
Mar 6, 2024, 9:16:55 PMMar 6
to Chromium-discuss

I built a system webview apk version 122 according to https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/build-instructions.md. However, I found that the apk is quite large, so I set the following build parameters to reduce the size of the apk. The parameters I set are as follows:

target_os = "android" target_cpu = "arm64" proprietary_codecs = true ffmpeg_branding = "Chrome" dcheck_always_on = false treat_warnings_as_errors = false dcheck_always_on = false is_debug = false is_component_build = false

The apk generated according to the above configuration is 275M.

Interestingly, after downloading from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Android_Arm64/1250228/, I found that the size of the system webview apk is only 238.9M.

I would like to know what build parameters are used for the system webview apk built at https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html, and how should I build my own webview to make their sizes roughly the same? Could you please inform me of some build parameters that can reduce the size of the apk, or what are the build parameters in https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Android_Arm64/1250228/? Thank you.

Reply all
Reply to author
Forward
0 new messages