Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

With the release of Android Studio 3.0 Beta release, the android studio provides next-generation dex compiler, D8 to compile code and build android APK. Currently, D8 is available for preview.

Check more details: https://android-developers.googleblog.com/2017/08/next-generation-dex-compiler-now-in.html

How to enable build using D8 in android studio?

like image 688
pRaNaY Avatar asked Aug 12 '17 08:08

pRaNaY


People also ask

What is d8 and R8?

D8 is a dexer that converts java byte code to dex code. R8 is a java program shrinking and minification tool that converts java byte code to optimized dex code.

What is DX and d8?

d8 is a command-line tool that Android Studio and the Android Gradle plugin use to compile your project's Java bytecode into DEX bytecode that runs on Android devices. d8 lets you use Java 8 language features in your app's code. d8 is also included as a standalone tool in Android Build Tools 28.0.

What is Dex compiler in Android?

The Dex compiler converts the class files into the . dex file that run on the Dalvik VM. Multiple class files are converted into one dex file.

How do you use Dexdump?

dexdump should be located in a version-specific folder under the build-tools/ folder of your Android sdk installation - at least if the latter is fully installed (ie, you can build and run apps).


2 Answers

To enable D8 for your Android Studio 3.0 Beta, you can add following line in your project's gradle.properties file:

android.enableD8=true
like image 80
pRaNaY Avatar answered Sep 23 '22 06:09

pRaNaY


If you do not have a gradle.properties file simple create it in your's root project directory (or folder) and add this line:

android.enableD8=true

like image 40
Nicolas Jafelle Avatar answered Sep 24 '22 06:09

Nicolas Jafelle