Read the three SDK settings together
An illustrative Kotlin DSL configuration looks like this:
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.
Follow one newer API call to an older device
Suppose a project compiles against an SDK containing a newer platform method while its minimum SDK still includes older devices. Compilation can resolve the method because the compile SDK supplies its declaration. That does not add the method to older operating systems. The implementation needs an appropriate runtime API-level guard or a supported compatibility path, and the older branch must provide meaningful behavior when the newer capability is unavailable.
For example, keep a feature's capability decision near the call that needs it, and test both branches. Avoid merely surrounding an entire screen with a broad exception handler: that can obscure unrelated bugs and leave users with a half-completed action. Android's Java version guide also distinguishes platform APIs from language features and toolchain settings; increasing a Java language level is not a substitute for checking Android API availability.
Investigate a library's minimum compile requirement
When AAR metadata reports a minimum compile SDK above the project's setting, identify the exact library and variant that introduced it. Check whether the intended library upgrade requires a newer Android plugin and installed platform. Update the owning convention or module setting once, then confirm all affected modules use it. A value changed in an unused catalog entry will not change the module's compilation environment.
Keep minimum and target SDK decisions separate during this repair. Raising compile SDK to satisfy a library can be a narrower change than raising the target and accepting new target-dependent behavior. If the project also changes the target, record that as an additional migration with its own tests rather than attributing every behavior change to compilation.
Run lint and release compilation, then exercise the relevant feature on the oldest supported API and a device with the new capability. Inspect the final manifest to verify the intended minimum and target values were preserved. Retain the source build configuration as evidence for compile SDK itself. An APK checker can describe the shipped manifest, but it cannot reconstruct every compiler platform, convention plugin and generated-source setting used to create that artifact.
Sources and further reading
- Android Developers: Configure the app module
- Android Developers: Current Android Gradle plugin release notes
Reference review: 29 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.


