android-gradle is a
gradle plugin officially maintained by Google Tools developer team and is the official build tool since the announcement in May 16, 2013 at the Google I/O.
Learn the basic by reading Configure your build with Gradle.
The main features of the Android Gradle Plugin are:
This video is about how to install the latest version or a specific version of gradle on a mac. Re-download gradle dependencies in android studio (Solved) - Duration: 3:09. Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder gradle-6.7 to your newly created C: Gradle folder. Alternatively you can unpack the Gradle distribution ZIP into C: Gradle using an archiver tool of your choice. Download the latest version of Gradle from the Download Gradle link.; emulator - this is the Android emulator that will be used later to preview the app on your Mac. In any case, delete the ‘/. This is available if the Gradle build is run with target Gradle version 2.6 or newer. Basic Web Project Support If you import a web project and your Eclipse contains the Web Tools Platform plugin then Buildship will automatically generate the WTP configuration files. Download the latest version: gradle-6.0 (the latest version on November 8, 2019). Remember to download the all version, which contains all relevant contents of the gradle SDK, including source code, documents, examples, etc.
- Modular Projects with libraries
- Variants through Flavors and Build Types
- IDE independent builds
- Download and install Android Studio
- open it and create a new project with all default settings
In theory you can install gradle directly, build the configuration files and directory structure by yourself. In practice no-one does that.
A project folder structure typically look like this:
A gradle project is usually divided in sub-project or modules each containing a dedicated build script.
The plugin dependency is usually declared in the main / top level
In this example the
android-gradle plugin version is
2.1.2 as you can see from this line:
The Project is divided into modules each containing a dedicated
build.gradle script. The
settings.gradle file list these modules:
: is used somewhat as a folder delimiter.
To use the plugin it has to be applied at the top of the
build.gradle file of each module (
app in the example).
For an Android Application:
Gradle 6.3 Download
For an Android Library:
And then configured in it's
build.gradle generated by Android Studio for an application looks like this:
Configure your build with Gradle teach you more advanced Android Gradle Plugin settings and options and go deeper in the meaning of this setting.
defaultConfig is called like that because it can be overridden with Product Flavors.
buildTypes tag allow you to setup how to build your app enabling optimization (like proguard), you can learn more reading Build Types. It can also be used to setup signing of your app.
You should also learn more on how to Declare Dependencies. As you see the
dependencies tag is outside the
android one: this means it's not defined by the Android plugin but it's standard
Android Studio will also, by default, install a gradle wrapper. This is a tool you can execute directly from the command line and it will download a local specific version of gradle the first time you execute it.
To launch compile the app you can then launch the gradle wrapper
Download Gradle Eclipse
Linux / Mac:
The script launch the wrapper, contained in a
gradle folder in the root directory of your project:
Download Gradle Mac
gradle-wrapper.jar: the code of the wrapper to download gradle and execute it
gradle-wrapper.propertiesdefine which gradle version the wrapper should download