Skip to content

Update the proguard rules with precise keep rules and bundle them as consumer-rules.pro #3667

Description

@AjeshRPai

The current documentation recommends broad keep rules
(-keep class com.yourcompany.yourgeneratedcode.** { *; }).

This prevents R8 from stripping unused generated protobuf models, leading to unnecessary app bloat.

Proposed Solution:

Replace the blanket documentation rules with granular ones that only preserve what Wire accesses reflectively (like ADAPTER, @WireField, and Enum Companions).

Ship these exact rules inside a consumer-rules.pro file within the Wire Android/Kotlin runtime artifact for a zero-config, optimized setup.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions