Gradle — How the App Gets Built
You press Run and, a few seconds later, Sprout appears on the emulator. Between those two moments, a tool compiled your code, packed your images, downloaded libraries and signed the result. That tool is Gradle, and you steer it with a few short files.
The rule
Settings names the modules; each module's build file says how to build it.
An Android project has a small set of Gradle files:
settings.gradle.kts— lists the modules in the project, likeinclude(":app"), and where to download libraries from.build.gradle.ktsin the project root — shared plugin setup.app/build.gradle.kts— the important one: how to build the app module.gradle/libs.versions.toml— the version catalog, one place for library versions.
android {
namespace = "com.example.sprout"
compileSdk = 35
defaultConfig {
applicationId = "com.example.sprout"
minSdk = 26 // oldest Android version allowed
targetSdk = 35 // version the app is designed for
versionCode = 3 // internal number, must go up each release
versionName = "1.2" // what users see
}
}
dependencies {
implementation(libs.androidx.activity.compose)
}applicationId is the app's unique identity on a device and in the store. implementation(...) adds a library your code can use.