Gradle is how Android apps are built, and the Android Gradle Plugin (com.android.tools.build:gradle) is the piece that teaches Gradle about Android — compiling resources, merging manifests, and producing APKs and App Bundles. Knowing your way around build.gradle is essential for both native Android and React Native projects.

Key takeaways

  • The Android Gradle Plugin version and Gradle version must be compatible.
  • Declare dependencies, SDK levels, build types, and flavors in build.gradle.
  • React Native Android projects are Gradle projects — the same rules apply.

Project vs module build files

An Android project has a top-level build file (plugin and repository setup) and a module build file per app/library (SDK versions, dependencies, build config). The Android Gradle Plugin pinned in the project file must match a compatible Gradle version, and mismatches are a common source of build failures.

Build types and flavors

Build types (debug, release) control signing, minification, and ProGuard/R8, while product flavors let you build variants — free vs paid, staging vs production — from one codebase. Together they produce the variant matrix you ship.

Why it matters for React Native

A React Native Android app is a Gradle project under the hood. Adding native dependencies, configuring signing, bumping the SDK level, or debugging a build error all happen in these same Gradle files, so the concepts transfer directly from native Android work.