O'Reilly logo

Mastering Android Studio 3 by Kyle Mew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Gradle build configurations

As the reader will have seen, Gradle scripts generally have a single project (or root) file and one or more module level files:

Gradle scripts

We are told not to edit this file in comments in the root script; unless we have configuration options common to all modules, this is best left as-is.

Module-level scripts are of far more interest to us and the following is a breakdown of a typical one.

The first line simply declares the use of the Gradle plugin:

apply plugin: 'com.android.application'

Next, Android-targeted API level and build tools versions are declared:

android { compileSdkVersion 27 buildToolsVersion ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required