This guide covers how to obtain d8.jar , how to use it via the command line, and common troubleshooting tips.
If your code uses parts of the Android framework (like android.app.Activity ), you must tell D8 where to find the android.jar for the specific API level you're compiling against. java -jar d8.jar --lib /path/to/sdk/platforms/android-33/android.jar --output out/ my_input.jar
D8 requires . Run:
file; it is distributed as part of the Android SDK and the open-source R8 project. Stack Overflow Android SDK (Standard Path): If you have the Android SDK installed, is located in your build tools directory: android_sdk/build-tools/ /lib/d8.jar ~/Android/Sdk/build-tools/29.0.3/lib/d8.jar Google Maven Repository: D8 classes are bundled in the com.android.tools:r8 artifact available at maven.google.com Prebuilt CI Artifacts:
Compile MyClass.class into classes.dex : d8.jar download
If you need a specific, bleeding-edge version of D8, you can build it from Google's source repository. Clone the repository: git clone https://googlesource.com cd r8 Use code with caution. Build the tool using Gradle: tools/gradle.py d8 Use code with caution.
/home/ /Android/Sdk/build-tools/ /lib/d8.jar This guide covers how to obtain d8
C:\Users\ \AppData\Local\Android\Sdk\build-tools\ \lib\d8.jar
This comprehensive guide covers everything you need to know about the d8.jar download, how to set it up, and how to use it via the command line. What is D8.jar? Run: file; it is distributed as part of
If you need to modify the tool or want the absolute latest code from the repository, you can build d8.jar from source.
Most developers use D8 via Gradle (Android Plugin). However, advanced users might need d8.jar standalone for: