Skip to content

Enable ProGuard for Android in release mode #11099

@goderbauer

Description

@goderbauer

We should enable ProGuard for Android builds in release mode. It removes unnecessary stuff from the APK and slims down the APK size.

More information: https://developer.android.com/studio/build/shrink-code.html

Currently, enabling ProGuard on the Flutter Gallery saves about 24KB. That's not a lot, but that number could grow. For example, with ProGuard enabled, we could start depend on the Android Support Libraries in the engine without bloating our APKs as ProGuard will strip out all unused code. For the accessibility work, I'd like to depend on the Android Support Libraries because they offer much needed convenience around the raw Android APIs and also easily ensure backwards compatibility to older API versions.

/cc @jakobr-google @mravn-google @tvolkert @Hixie

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-androidAndroid applications specificallyt: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions