Mobile Development 43 min read

How Youku Cut Android APK Size Over Five Years: Strategies, Tools, and Governance

This article reviews Youku's five‑year journey of Android APK size reduction, detailing the shift from special‑project squeezes to sustainable normal governance, the technical measures and analysis tools like Franky, and practical slimming techniques that can help any mobile team manage package size efficiently.

Alibaba Cloud Developer
Alibaba Cloud Developer
Alibaba Cloud Developer
How Youku Cut Android APK Size Over Five Years: Strategies, Tools, and Governance

Five‑Year Governance Review

Since 2017 Youku has continuously invested in reducing Android APK size, recognizing that package size directly impacts download conversion, user acquisition cost, and growth. The effort is divided into three special‑project phases and two years of normal governance, each with distinct technical, strategic, and organizational approaches.

Special Governance (2017‑2020)

Three rounds of intensive slimming reduced the APK from a peak of 73 MB to 51 MB (≈30% reduction) using conventional techniques such as removing unused modules, remote‑loading edge features, and image compression. Subsequent rebounds highlighted the need for better goal tracking and broader team involvement.

Normal Governance (2020‑Present)

From September 2020 onward, a steady normal‑governance mode lowered the APK from around 100 MB to 64.4 MB by integrating size checkpoints into the CI/CD pipeline, employing the Franky analysis tool, and encouraging all client teams to treat size as a core quality metric alongside stability and performance.

Governance Modes

Special‑project governance focuses on rapid, short‑term size cuts with dedicated teams and fixed milestones, while normal governance embeds size control into daily development, distributing responsibility to owners of each feature or module. The transition emphasizes shifting focus from "what" to "who"—ensuring developers understand the origins of every byte.

Technical Support

The core of technical support is precise size analysis: measuring the real contribution of each class, resource, or native library within the APK. Franky, a Gradle plugin plus CLI tool, collects module composition, code coverage, and mapping data to produce detailed reports that guide and evaluate slimming actions.

Analysis Techniques

Franky provides granular metrics at class, resource, module, feature, business, and team levels, enabling developers to identify unused code, un‑obfuscated classes, oversized resources, duplicate assets, multi‑configuration resources, transparent PNGs, similar files, non‑standard STL usage, and dead exported symbols. Coverage approaches aim for near‑100% attribution of APK elements to responsible owners.

Slimming Techniques

Techniques are grouped into remote‑loading, whole‑package optimizations, and single‑point fixes. Remote‑loading (so, bundle, resources) moves functionality off‑device. Whole‑package methods include Proguard/R8, D8, R‑class merging, dex layout optimization, 7z compression, resource shrinking, multi‑configuration pruning, image compression, resource name obfuscation, and native library stripping. Single‑point fixes target specific waste such as unused classes or large resources.

Future Outlook

Continued commitment, treating size as a development pillar, and leveraging size‑driven refactoring can improve overall code health, performance, and engineering efficiency. Ongoing exploration of native‑library analysis, smarter keep‑rule generation, and better integration with emerging AndroidX components will keep the governance loop evolving.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

performanceAndroidpackage optimizationAPK size
Alibaba Cloud Developer
Written by

Alibaba Cloud Developer

Alibaba's official tech channel, featuring all of its technology innovations.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.