Field Notes: Flavors, SDK Levels & CI
The second set of field notes is about the build matrix: how many variants you configure, which Android versions you support, and what CI actually needs to build.
Flavor explosion is real, and measurable
Every flavor dimension multiplies the variant count, and AGP creates tasks for every variant during configuration, whether you build it or not. The session measures it on the same tiny app with more and more flavors:
bash · try it yourself
mkdir -p hello/app/src/main && cd hello
cat > settings.gradle.kts <<'KTS'
pluginManagement { repositories { google(); mavenCentral(); gradlePluginPortal() } }
dependencyResolutionManagement { repositories { google(); mavenCentral() } }
rootProject.name = "hello"
include(":app")
KTS
echo 'plugins { id("com.android.application") version "9.4.1" apply false }' > build.gradle.kts
echo '<manifest xmlns:android="http://schemas.android.com/apk/res/android"><application android:label="Hello" /></manifest>' > app/src/main/AndroidManifest.xml
gradle wrapper > /dev/null
measure() { # $1 = description, $2 = productFlavors block
cat > app/build.gradle.kts <<KTS
plugins { id("com.android.application") }
android {
namespace = "com.example.hello"
compileSdk = 36
defaultConfig { applicationId = "com.example.hello"; minSdk = 24; targetSdk = 36; versionCode = 1; versionName = "1.0" }
$2
}
KTS
./gradlew -q tasks --all > tasks.txt
variants=$(grep -E 'Assembles main output for variant [a-zA-Z]+