tips on how to reduce android release binary size

41 views
Skip to first unread message

Bruno

unread,
Apr 23, 2020, 11:40:11 PM4/23/20
to skia-discuss
I'm trying to reduce my final app size as much as I can and one thing that did that make a huge difference was to use icu's dat file from third_party\externals\icu\flutter, besides that, is there anything more I could do to reduce it even more?
this is how I'm building skia:
bin\gn.exe gen out/android_armeabi-v7a_release --args="ndk=\"C:\Android\Sdk\ndk\21.1.6352462\" target_cpu=\"arm\" cc=\"clang\" cxx=\"clang++\" is_official_build=true is_debug=false skia_use_expat=true skia_use_system_expat=false skia_use_libpng_decode=true skia_use_libpng_encode=true skia_use_system_libpng=false skia_use_libjpeg_turbo_encode=false skia_use_libjpeg_turbo_decode=false skia_use_libwebp_encode=false skia_use_libwebp_decode=false skia_use_harfbuzz=true skia_use_system_harfbuzz=false skia_use_icu=true skia_use_system_icu=false skia_enable_skottie=false skia_enable_pdf=false skia_enable_fontmgr_android=true skia_use_freetype=true skia_use_system_freetype2=false skia_use_zlib=true skia_use_system_zlib=false skia_use_xps=false skia_use_sfntly=false skia_enable_particles=false skia_use_dng_sdk=false skia_use_piex=false skia_enable_skparagraph=true"

Thanks!

Brian Osman

unread,
Apr 24, 2020, 7:34:53 AM4/24/20
to skia-d...@googlegroups.com
I assume you're using the GPU backend? If not, you can actually disable it (skia_enable_gpu=false) and get a large amount of code size back. The downside is that the CPU backend is going to be quite a bit slower, so I'd only recommend this if you're not doing animation or otherwise need consistent high frame rates. Beyond that, it looks like you've disabled most of the easy components (you're only including one image codec, etc.)

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/1e0594a8-7e8d-4889-b400-9411440c85e2%40googlegroups.com.

Bruno Piovan

unread,
Apr 24, 2020, 8:38:56 AM4/24/20
to skia-d...@googlegroups.com
hi Brian,
yes I'm using GPU backend. So I think I already got the minimum then.

Thanks!

Reply all
Reply to author
Forward
0 new messages