How to enable dex compiler D8(Next-generation Dex Compiler) in android studio

Viewed 9645
4 Answers

R8, is available for preview as part of Android Studio 3.0 Beta

To try it, set the following in your project's gradle.properties file:

android.enableR8=true 

R8 also has full mode that is not directly compatible with Proguard. In order to try that out you can additionally set the following in your gradle.properties file:

android.enableR8.fullMode=true

You can check this blog for further details

As others mentioned, you can enable D8 via android.enableD8=true in your gradle.properties but in case you encountered compile error as such "Process 'command 'xxx/bin/java'' finished with non-zero exit value 1" on a project migrated/imported into the new Android Studios 3.1+ , then try with this:

android.enableD8.desugaring=true

This will execute desugaring as part of D8 which speeds up the process.

Related