بنقرة واحدة
pin-r8-version
Pin R8 to a specific published dev release or to a particular commit on R8's `main` branch.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Pin R8 to a specific published dev release or to a particular commit on R8's `main` branch.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | pin-r8-version |
| description | Pin R8 to a specific published dev release or to a particular commit on R8's `main` branch. |
Use this skill when overriding the R8 version bundled with AGP is necessary.
To check the current R8 version bundled by AGP:
./gradlew :app:minifyProdReleaseWithR8 --rerun-tasks
head -5 android/app/build/outputs/mapping/prodRelease/mapping.txt
Look at compiler_version (e.g. 9.4.6-dev, or main) and
compiler_hash (a git commit SHA on R8's repo).R8 maintains release branches named 9.0, 9.1, …, 9.4, etc. Each release
branch has commits like Version 9.4.6-dev, Version 9.4.7-dev, … Every such
tagged version is published to Maven at
https://storage.googleapis.com/r8-releases/raw under the coordinate
com.android.tools:r8:<version>-dev.
List available branches:
curl -s "https://r8.googlesource.com/r8/+refs/heads?format=JSON" \
| tail -c +6 \
| jq -r 'keys[] | select(test("^[0-9]"))'
List recent commits on a specific release branch (replace 9.4):
curl -s "https://r8.googlesource.com/r8/+log/refs/heads/9.4?n=30&format=JSON" \
| tail -c +6 \
| jq -r '.log[] | "\(.commit[:12]) \(.message | split("\n")[0])"'
The Version X.Y.Z-dev commits mark released dev versions. Verify a specific
one is actually published (should return HTTP 200):
curl -sI "https://storage.googleapis.com/r8-releases/raw/com/android/tools/r8/9.4.7-dev/r8-9.4.7-dev.pom" | head -1
mainR8 publishes every merged commit on main as a raw jar keyed by the full
40-character commit SHA. There is no maven POM — only the raw jar file.
List recent commits on main:
curl -s "https://r8.googlesource.com/r8/+log/refs/heads/main?n=30&format=JSON" \
| tail -c +6 \
| jq -r '.log[] | "\(.commit) \(.message | split("\n")[0])"'
Verify a specific commit's jar is published (should return HTTP 200):
curl -sI "https://storage.googleapis.com/r8-releases/raw/main/<FULL_40_CHAR_SHA>/r8.jar" | head -1
Add a buildscript block after the dependencyResolutionManagement block
in the root settings.gradle.kts.
buildscript {
repositories {
maven("https://storage.googleapis.com/r8-releases/raw") {
content { includeModule("com.android.tools", "r8") }
}
}
dependencies {
classpath("com.android.tools:r8:9.4.7-dev")
}
}
main (raw jar via ivy)Main-branch builds don't publish a POM, so an ivy repository with a custom
pattern is required. [revision] here is the full 40-character SHA.
buildscript {
repositories {
ivy("https://storage.googleapis.com/r8-releases/raw/main") {
patternLayout {
artifact("[revision]/[artifact].[ext]")
}
metadataSources { artifact() }
content { includeModule("com.android.tools", "r8") }
}
}
dependencies {
classpath("com.android.tools:r8:297e591e1842089b281de5d5286760eca4f5c944")
}
}
Re-run the minify task:
./gradlew :app:minifyProdReleaseWithR8 --rerun-tasks
Inspect the mapping header:
head -5 android/app/build/outputs/mapping/prodRelease/mapping.txt
Confirm both:
compiler_version — will be X.Y.Z-dev for Option A, or literally main
for Option B.compiler_hash — matches the release commit (Option A) or the exact SHA
you pinned (Option B).