Reduce android system webview size

425 views
Skip to first unread message

Xuening Deng

unread,
Apr 27, 2021, 12:14:00 AM4/27/21
to Chromium-discuss

Hi

    Is there anybody have doc or article for reducing size of android webview ? I tried google search, did't find useful information.

    My company has a product whose OS is Android 8.1. webview version is 88. The size of webview is 45.1MB. Recently, the system space is getting scarce,I plan to cut some unused modules of webviews, such as: plugins, printing, language pack,ext.  

 

 

Torne (Richard Coles)

unread,
Apr 27, 2021, 11:44:55 AM4/27/21
to Xuening Deng, Chromium-discuss
WebView language support is extremely tiny and reducing language support will make virtually no difference; we just have very few strings that would need to be translated. WebView (or Chrome on Android) has never supported plugins. Removing printing or other features would likely cause CTS tests to fail as many of these APIs are covered by tests, and so you would not be able to pass CTS. If you do find features you can remove without failing CTS then this is still likely to cause compatibility issues in practise with apps - apps assume that a given version of WebView always supports the same functionality.

What GN arguments are you using to build your WebView? There may be ways to get a smaller build without removing anything functional. However, 45MB is fairly small already... most of our builds are much larger than that.

Xuening Deng

unread,
May 7, 2021, 3:34:41 AM5/7/21
to Chromium-discuss, to...@chromium.org, Chromium-discuss, Xuening Deng
Thanks for your reply. I do think removing some features is not a good choice.

My GN arguments: gn gen --args='target_os="android" target_cpu="arm" proprietary_codecs=true ffmpeg_branding="Chrome" is_debug=false is_official_build=true is_chrome_branded=false use_official_google_api_keys=false exclude_unwind_tables=true enable_resource_whitelist_generation=true enable_remoting=true symbol_level=1' out/webview88

Is there ways to get a smaller build ?

Torne (Richard Coles)

unread,
May 7, 2021, 9:41:45 AM5/7/21
to Xuening Deng, Chromium-discuss
I'm not aware of any settings which will make it smaller than that. That's the expected size for an arm32 build.
Reply all
Reply to author
Forward
0 new messages