# r8-analyzer

> Claude/Codex skill by [@android](https://omgskills.com/library/android/index.md) · 10k stars · Updated 2026-10-26

Analyzes Android build files and R8 keep rules to identify redundancies, broad package-wide rules, and rules that subsume library consumer keep rules. Use this skill when developers want to optimize their Android app's size, remove redundant or overly broad keep rules, or troubleshoot ProGuard configurations. Don't use for general Gradle build errors, Compose UI performance, or runtime CPU profiling.

Tags: skills

## Install

```sh
git clone https://github.com/android/skills /tmp/skills && ln -s /tmp/skills/performance/r8-analyzer ~/.claude/skills/r8-analyzer
```

## From README

Step 1. and configuration check Inspect build.gradle, build.gradle.kts, and gradle.properties. Use references/CONFIGURATION.md to identify missing optimizations. AGP : If the version is lower than 9.3, suggest migration to 9.3 for the simplified optimization {} DSL and the Configuration Analyzer task. Full mode : Verify android.enableR8.fullMode=false is removed from the gradle.properties file. Step 2. Analysis path selection Inspect build.gradle, build.gradle.kts, settings.gradle, settings.gradle.kts, gradle.properties, and libs.versions.toml to get the AGP and R8 versions. An R8 version pinned in settings.gradle(.kts) replaces the R8 bundled with AGP. Find the app module (usually app) and a build variant with R8 enabled (usually release). The following commands use them as and , for example :app:minifyReleaseWithR8. The helper scripts are in this skill's scripts/ directory. In the following commands, is this skill's directory. Run every command from the project root.

## Links

- HTML page: https://omgskills.com/library/android/skills/r8-analyzer/
- GitHub: https://github.com/android/skills
- Author: [@android](https://omgskills.com/library/android/index.md)

## More from this repo

- [android-cli](https://omgskills.com/library/android/skills/android-cli/index.md) — Provides instructions for installing and using the \`android\` CLI.
   - [@android](https://omgskills.com/library/android/index.md) · 10k stars
- [android-intent-security](https://omgskills.com/library/android/skills/android-intent-security/index.md) — Best practices for Android Intent security.
   - [@android](https://omgskills.com/library/android/index.md) · 10k stars
- [navigation-3](https://omgskills.com/library/android/skills/navigation-3/index.md) — Learn how to install and migrate to Jetpack Navigation 3, and how to implement features and patterns such as deep...
   - [@android](https://omgskills.com/library/android/index.md) · 10k stars
