Skip to content

Instantly share code, notes, and snippets.

@G00fY2
Last active September 28, 2022 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save G00fY2/42f27e1001c14b1133a9e9bea9a72ac4 to your computer and use it in GitHub Desktop.
Save G00fY2/42f27e1001c14b1133a9e9bea9a72ac4 to your computer and use it in GitHub Desktop.
R8 Shrinker tweaks

Gradle task that prints the currently used R8 version

tasks.register("printR8Version") {
  try {
    println("R8 version: ${com.android.tools.r8.Version.getVersionString()}")
  } catch (ignored: Exception) {
    println("R8 version: unknown")
  }
}

All versions and the sourcecode over here: https://r8.googlesource.com/r8/+refs

Overwrite R8 version

Add this to your project build.gradle:

buildscript {
  repositories {
    google()
  }
  dependencies {
    classpath("com.android.tools:r8:2.2.64")
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment