20

I added the new setting:

 android.enableR8 = true 

to my Gradle file but and 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?

Oren Bochman
  • 1,076
  • 3
  • 17
  • 36

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
  • 324
  • 3
  • 5
  • 2
    i am using android studio 3.3.0, and the warning still exist – raditya gumay Jan 26 '19 at 05:42
  • 1
    3.4.0 only warns if used fullMode, i.e. `android.enableR8.fullMode = true` – DarShan Apr 25 '19 at 11:05
  • 3
    Still warns in Android Studio 3.5......The option setting 'android.enableR8.fullMode=true' is experimental and unsupported. – arv Aug 27 '19 at 07:30
  • It still warns with AS 3.6.1 and the warning now was valid for me, as with this update constructors marked as keep started being removed. Had to disable it to make my code work again. – InI4 Mar 10 '20 at 11:42
  • 3 years later, it's still experimental in Arctic Fox Beta 1 with gradle 7.0.0 :( – Hrk May 19 '21 at 16:20
  • 1
    3 years later in 2021. it's still warns but now it says It will be removed in version 5.0 of the Android Gradle plugin. – Aditya Patil Jun 03 '21 at 10:07
  • 1
    still warns in 2022 – nnamdi Mar 25 '22 at 22:28
14

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

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

Wirling
  • 4,085
  • 2
  • 40
  • 70
Shuvo
  • 197
  • 1
  • 5
  • 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