r8-analyzer

Analyze Android R8 keep rules for redundancies and excessive scope.

6.6k|388|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/android/skills --skill r8-analyzer-android
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r8-analyzer
Source: https://github.com/android/skills/tree/main/performance/r8-analyzer
Command: npx skills add https://github.com/android/skills --skill r8-analyzer-android

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you find and remove redundant or overly broad R8 keep rules that reduce shrinking, inflate app size, and complicate Proguard configuration troubleshooting.

Core Features & Use Cases

  • R8 configuration triage: Checks your Gradle build files and R8-related flags to confirm whether the project is set up for full optimization.
  • Keep-rule impact analysis: Uses the R8 Configuration Analyzer (when available) to quantify how keep rules affect optimization and identify the most impactful rules.
  • Heuristic fallback evaluation: When quantitative analysis cannot run, it analyzes proguard-rules.pro for broad/package-wide patterns and redundant rules using reference guidance.
  • Production-oriented reporting: Outputs a raw Markdown report following the repository’s required report format for easy review and action.

Use Case Example: You suspect your proguard-rules.pro contains package-wide -keep rules or rules that subsume library consumer keep rules, and you want to measure how much they actually prevent R8 optimizations before rewriting your configuration.

Quick Start

Use the r8-analyzer skill to analyze your app’s current R8 keep rules and produce a Markdown report of optimization impact based on your build configuration.

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 R8 keep rules that are inflating my APK size?

To find redundant R8 keep rules, analyze your Gradle build files and proguard-rules.pro to identify overly broad package-wide patterns and measure their optimization impact. This process outputs a Markdown report highlighting rules that reduce shrinking.

What is R8 full-mode readiness and how do I validate it for a release build?

R8 full-mode readiness validates whether your Android project is configured for complete optimization. It involves checking your Gradle build files and R8-related flags to confirm setup and identify any keep rules preventing full optimization before release.

How do I troubleshoot Proguard configuration issues without quantitative analysis tools?

You can troubleshoot Proguard configuration issues using heuristic fallback evaluation by analyzing your proguard-rules.pro file for broad package-wide patterns and redundant rules based on reference guidance when quantitative analysis cannot run.

Can I measure how specific keep rules affect Android app size optimization?

Yes, you can measure keep rule impact on app size optimization by running the R8 Configuration Analyzer. It quantifies how specific keep rules affect optimization and identifies the most impactful rules blocking shrinking.

Does the R8 Configuration Analyzer work with existing Gradle build configurations?

Yes, the R8 Configuration Analyzer works with existing Gradle build configurations by inspecting Gradle files and gradle.properties. It evaluates your current R8 version behavior and rule impact on optimization outcomes.