Google Play Publishing

compileSdk Explained: Compile-Time APIs Are Not Your Minimum Android Version

compileSdk chooses the Android API definitions available while compiling an app. It does not specify the oldest Android version allowed to install it, and raising it alone does not satisfy Google Play's target-API requirement. Keep compile-time access, runtime compatibility and store policy as three separate decisions.

By Updated 2 min read

Read the three SDK settings together

An illustrative Kotlin DSL configuration looks like this:

KOTLIN · REFERENCE EXAMPLE
android {
    compileSdk = 36
    defaultConfig {
        minSdk = 23
        targetSdk = 36
    }
}

Here the compiler can resolve API 36 symbols, installation starts at API 23, and target-dependent behavior uses the app's API 36 contract. These values illustrate the distinction; they are not a universal configuration for every form factor or dependency graph.

The traditional compileSdkVersion name in older Gradle examples describes the same compile-time setting. Do not add both spellings to different files and assume the larger value wins.

Diagnose a compileSdk upgrade request

A dependency may declare a minimum compile SDK through its AAR metadata. When Gradle reports that the project compiles against an older API, identify the dependency and read the full requirement before changing the toolchain.

Check the Android Gradle plugin's supported API range, install the required SDK platform, and update the module configuration or convention plugin that actually owns the setting. A version-catalog variable is not effective until the module uses it.

Run a clean build and lint on the release variant. A successful compile does not prove newly referenced APIs exist on your oldest supported phone. Guard newer calls by runtime API level or use an appropriate compatibility library.

Inspect the artifact without over-interpreting it

APK inspection can reveal minSdkVersion and targetSdkVersion; it is not a reliable substitute for reviewing the source build's compileSdk configuration. The APKLint Target SDK Checker should therefore be used to verify the shipped target, not to reconstruct the complete Gradle toolchain.

Record the Gradle Wrapper, Android Gradle plugin, JDK, SDK platform and resolved dependency versions together. This makes a future build failure reproducible instead of leaving “latest SDK” as an unrepeatable instruction.

Consult Android's module configuration and the plugin compatibility notes before selecting the final combination.

Sources and further reading

  1. Android Developers: Configure the app module
  2. Android Developers: Current Android Gradle plugin release notes

Reference review: 22 September 2026. Examples illustrate the workflow; check your installed versions, release artifact and account-specific Console requirements before applying them. This guide is not a claim that APKLint executed your project or verified your private account.

APKLint

Android inspection tools and practical release guides. About APKLint · Report a correction