r8-analyzer

Analyze Android R8/Proguard keep rules to identify redundant or overly broad rules.

2|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/iadr-dev/colab --skill r8-analyzer-iadr-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/iadr-dev/colab/tree/main/skills/coding/android/performance/r8-analyzer
Command: npx skills add https://github.com/iadr-dev/colab --skill r8-analyzer-iadr-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps identify overly broad or redundant Android R8/Proguard keep rules that prevent code shrinking and can bloat your release APK/AAB size.

Core Features & Use Cases

  • Configuration review: Inspects build.gradle / build.gradle.kts and gradle.properties to understand whether R8 and resource shrinking are enabled correctly for your AGP version.
  • Keep-rule diagnosis: Evaluates Proguard keep rules in a structured order (library redundancy first, then impact hierarchy, then subsuming/broader rules) to find what can be removed or refined.
  • Reflection-aware refinement: Detects likely reflection usage within affected packages and suggests narrow keep rules tailored to the actual dynamic-loading scenario.
  • Actionable remediation plan: Produces concise per-rule actions (remove vs refine) and prioritizes changes by codebase impact hierarchy, then recommends targeted UI Automator testing.

Quick Start

Use the r8-analyzer skill on your Android project to generate R8 keep-rule reduction recommendations in R8_Configuration_Analysis.md.

Frequently Asked Questions about r8-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find redundant Proguard keep rules that bloat my Android release APK?

To find redundant Proguard keep rules that bloat your Android release APK, analyze your build configuration and R8 keep rules by checking library redundancies and broader subsuming rules. This structured diagnosis isolates overly broad preservation rules blocking code shrinking.

What is the impact hierarchy for classifying R8 keep rules?

The impact hierarchy for classifying R8 keep rules prioritizes library redundancy first, then evaluates impact levels, and finally checks subsuming or broader rules. This structured classification order identifies which rules can be safely removed or refined to improve shrinking.

How do I fix R8 shrinking issues when my app uses reflection?

To fix R8 shrinking issues when your app uses reflection, detect likely dynamic-loading scenarios within affected packages and apply narrow keep rules tailored to the specific reflection usage. This targeted refinement prevents overly broad preservation while maintaining runtime functionality.

Does this R8 analyzer work with my AGP version and build.gradle.kts files?

Yes, this R8 analyzer works with your AGP version and build.gradle.kts files by inspecting build.gradle or build.gradle.kts and gradle.properties. It verifies whether R8 and resource shrinking are enabled correctly for your specific AGP version.

What is the best way to reduce app size by narrowing keep rules?

The best way to reduce app size by narrowing keep rules is to generate a per-rule remediation plan that prioritizes removal or refinement by codebase impact hierarchy. This produces concise actions and recommends targeted UI Automator testing to verify changes.

Why does my R8 configuration analysis recommend removing certain keep rules?

Your R8 configuration analysis recommends removing certain keep rules because they are redundant with library-provided rules or are subsumed by broader existing rules. Removing these unnecessary rules unblocks the shrinking process and reduces final release bundle size.