20

I added the new setting:

android.enableR8 = true 

to my Gradle file but I got the following warning from the compiler

WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.

any suggestions on how to get this to work?

Ramesh R
  • 7,009
  • 4
  • 25
  • 38
Oren Bochman
  • 1,173
  • 3
  • 16
  • 37

2 Answers2

16

This is a new feature. The warning is just that. It already works.

The warning will disappear in a future version of Android Studio.

sander
  • 354
  • 3
  • 5
15

Just delete android.enableR8=true from your gradle.properties and Sync again.

Wait till sync is finished, then you will find everything is working fine...

Ramesh R
  • 7,009
  • 4
  • 25
  • 38
  • 2
    that means the android tool may fallback to proguard or may not obfuscate and optimise code at all. – ir2pid Nov 24 '20 at 14:33
  • 4
    @ir2pid R8 is now enabled by default for both app and Android library projects using Android Gradle plugin 3.4.0 and higher. – Sabet Chowdhury Apr 23 '21 at 10:43