Skip to content

Setup#

Declarative Gradle samples require nightly versions of Gradle and Android Studio. They all use the Gradle Wrapper to point to the right Gradle version, so you don't have to worry about installing a specific version of Gradle.

To try out the samples and see all of the features, you need to install a few other components as described below:

JDK#

Make sure to use a JDK >= 17 and that your JAVA_HOME points to it.

You can use a JDK from any vendor. We recommend Eclipse Temurin™ (OpenJDK).

Android Studio#

Download and install the Android Studio Nightly 2024.1.3.3 released on 2024-07-26.

Declarative features are only available on particular nightly releases.

Enable more declarative features in Studio#

Info

While syntax highlighting of .gradle.dcl files works out of the box in Studio nightlies, other features require flags to be enabled.

  1. Open Help -> Open Custom Vm Options
  2. Add text -Didea.is.internal=true
  3. Restart the IDE
  4. Open Tools -> Internal Actions -> Android -> Edit Studio Flags and type "Gradle Declarative" in the search window
  5. Switch on the Studio support for declarative files flags.

Install the Gradle Client#

The Gradle Client is a standalone application used to demonstrate declarative features not yet implemented in the IDE.

Download the latest release from the Gradle Client repository on GitHub and install it.

The DMG file is for macOS, the DEB file is for Linux and the MSI file is for Windows.

Pick a sample#

After you've installed everything, pick out a samples to try the Declarative Gradle features.