Understanding the Gradle files
When creating a new project with Android Studio, three Gradle files are generated by default. Two of those files, settings.gradle
and build.gradle
, end up on the top level of the project. Another build.gradle
file is created in the Android app module. This is how the Gradle files are placed in the project:
MyApp ├── build.gradle ├── settings.gradle └── app └── build.gradle
These three files each serve their own purpose, which we will further look into in the upcoming sections.
The settings file
For a new project containing only an Android app, settings.gradle
looks like this:
include ':app'
The settings file is executed during the initialization phase, and defines which modules should be included in the build. In this example, the app
module is included. Single module projects do not necessarily require a settings file, but multimodule projects do; otherwise, Gradle...