Is r8 enabled on existing project after updating Android studio?

Yava picture Yava · Apr 23, 2019 · Viewed 7.6k times · Source

I updated Android studio and if I'm correct the update includes R8 by default to my projects. The question is is r8 only activated by default on new projects or did the update include that change also to my already created project? If not how can I make use of it.

Answer

Ian Zerny picture Ian Zerny · Apr 29, 2019

In Android Studio 3.4, R8 is used by default for all projects that don't disable it. You can switch to Proguard with:

  • android.enableR8 = false in gradle.properties; or
  • useProguard = true in your build.gradle.

In Android Studio 3.5, the useProguard flag has no effect. That means that R8 is always used, unless you add android.enableR8=false in gradle.properties.