checkDebugAarMetadata Failed: Read the AAR Requirement First

Execution failed for task ':app:checkDebugAarMetadata' names the compatibility gate that stopped the build—not usually the root cause. Read the concrete numbered metadata issues underneath it. A dependency can require a minimum compileSdk, Android Gradle Plugin (AGP), or compile-SDK extension, and one task can report multiple requirements at once. Inventory the requirements for the failing module/variant before changing versions, then choose the smallest coherent supported build stack that satisfies them.

Android · Gradle · AAR MetadatacompileSdk · AGP · DependenciesLast reviewed Sep 27, 2026
🎯 You’re likely in the right place if:
The build says Execution failed for task ':app:checkDebugAarMetadata' or the same task for another module/variant.The lines below list one or more issues were found when checking AAR metadata.A dependency names a minimum compile SDK, AGP version, or SDK-extension requirement.
Read the first concrete AAR requirement under the task failure
requires ... compile against version X or later →Compare the dependency's minimum compile SDK with the consuming Android module's effective compileSdk.requires Android Gradle plugin X or higher →Check the dependency's minimum AGP requirement and the build's actual AGP version.Requires a compile SDK extension →Match the extension requirement rather than changing unrelated SDK numbers.Error started after dependency upgrade →Compare old/new dependency requirements before upgrading the whole toolchain or downgrading randomly.Flutter / React Native / multi-module project →Find the Android module that consumes the AAR and its effective build configuration.Only the task wrapper is visible →Expand/rerun that exact task and capture the first metadata issue underneath it.
Difficulty: ModerateRisk: Low if scoped
🔎 Quick Check — capture the concrete dependency requirements, not the task name

Under checkDebugAarMetadata, capture the numbered issues that name dependencies and what each requires for the same failing module/variant. Start diagnosis with the first concrete issue, but scan the full metadata block before editing versions so you do not fix compileSdk only to discover that the same dependency also requires a newer AGP or extension level.

Dependency 'group:library:version' requires libraries and applications that depend on it to compile against version X or later of the Android APIs.

Verify: you can name both sides of every relevant mismatch in that metadata block: which dependency requires which minimum build capability, what the consuming module currently uses, and whether several requirements must be satisfied together.

Did you identify the dependency and its requirement?
ADSENSE · reserved slot after the first useful step

What checkAarMetadata is actually checking

Android libraries are distributed as AARs. AAR metadata can declare compatibility requirements for consumers, including a minimum compileSdk, minimum AGP version, and minimum compile-SDK extension. Android's documentation describes these fields as build-time requirements intended to fail early with a useful message instead of producing a later ambiguous resource or tooling error.

1
Dependency
Which AAR/library is named?
2
Requirement
Is it minCompileSdk, minAgpVersion, or a compile-SDK extension?
3
Consumer
Which Android module/variant is consuming it, and what effective configuration does that module use?

Fix #2 — dependency requires a higher compileSdk

minCompileSdk is a floor declared by the AAR: the consuming module's effective compileSdk must be at least that value. It is not an instruction that your project must use exactly that number, and it is not the library's minSdk. Compare the requirement printed in your error with the effective compileSdk of the module consuming that dependency.

Do not change minSdk or targetSdk just to satisfy this message. compileSdk controls the Android APIs/resources available while compiling. minSdk is the app's minimum runtime/install API boundary, while targetSdk controls runtime behavior and tested-target semantics. They are different decisions.

Before raising compileSdk, confirm that the required Android platform is installed and check the actual AGP release's documented compile-SDK support/recommendation and toolchain requirements. A higher minCompileSdk does not by itself prove that AGP must change; if the current AGP cannot support the selected compile SDK cleanly, then evaluate the coherent chain dependency requirement → compileSdk → AGP → Gradle → JDK. Use the official compatibility/release guidance for the exact versions instead of assuming every compileSdk increase requires a full toolchain upgrade.

Verify: rerun the exact same module/variant task. The original minCompileSdk issue should disappear, and re-read the entire remaining metadata issue block. If another requirement remains, treat it as the next compatibility boundary rather than changing unrelated SDK values.

Fix #3 — dependency requires a newer Android Gradle Plugin

AAR metadata can declare minAgpVersion: the minimum AGP version required to consume the library. If that is the concrete issue, changing compileSdk alone does not satisfy it.

Locate where your project actually declares AGP—such as the plugins DSL, version catalog, settings/plugin management, or framework-generated build configuration—and assess the AGP upgrade as a build-toolchain change. Then check the official compatibility requirements for that AGP release: the Gradle version and JDK used to run Gradle must also be supported. Do not assume that because Android Studio launches on one JDK, the Gradle build is necessarily using that same runtime.

Do not upgrade AGP, Gradle, JDK and every Android SDK number simultaneously unless the supported upgrade path requires it. Preserve the original requirement and make the smallest coherent toolchain change you can verify.

Verify: The build now uses an AGP version that meets the named AAR requirement, and that exact minAgpVersion metadata issue is gone.

Fix #4 — the AAR requires a compile SDK extension

AAR metadata can also declare a minimum minCompileSdkExtension. This is a separate floor for an SDK extension level used when compiling against an extension SDK. Do not collapse it into the base API number: a numerically higher compileSdk alone does not prove that the required extension level is selected and available.

Read both parts of the diagnostic: the base compile SDK/API context and the required extension level. Confirm the relevant extension SDK is installed/configured and that the project's AGP supports the configuration you intend to use. Do not change minSdk or invent an extension value merely to silence the metadata check.

Verify: The consuming module satisfies the named extension requirement and the same metadata issue no longer appears.

Fix #5 — a dependency upgrade introduced the failure

If the build was green before a library update, compare the AAR requirement reported for the new version with your current build stack. You have two legitimate directions: adopt the newer supported build capability, or use a dependency release whose documented requirements match the toolchain you intentionally support.

Do not downgrade randomly until the task passes. Before pinning an older release, read that library's release notes/changelog and security advisories when available. Check whether the older version loses vulnerability fixes, bug fixes, required APIs, behavior changes, or compatible transitive dependencies. Prefer a maintained release that explicitly supports your current toolchain; if you must pin, record the reason and the condition for removing the pin.

Verify: The selected dependency/toolchain combination is intentional and reproducible, and the same AAR metadata check passes on a clean checkout/CI environment—not only one developer machine.

Fix #6 — Flutter, React Native, or multi-module build: find who owns the Android value

The outer framework does not change what the AAR metadata means, but it can change who owns the configuration. Find the Android module/variant named by the failing task and determine where its effective compileSdk, AGP and dependencies come from. In multi-module builds, changing an unrelated module may leave the failing consumer unchanged.

Before editing generated or template-managed Android files, check whether Flutter, React Native, a framework plugin, convention plugin, version catalog, settings plugin, or root build logic supplies the value. Framework upgrades can intentionally move or regenerate Android build settings. A local edit that makes one build pass can disappear on regeneration or leave the project outside the framework's supported toolchain.

If build properties are centralized, remember that modern Android builds can define common SDK settings at project/settings level while module-level values can override them. Confirm the effective value used by the failing module, then change the authoritative source for that project—not merely the first compileSdk string you find.

Verify: Rerun the same module/variant task and confirm the original dependency requirement is gone.

What not to do

Do not troubleshoot the words checkDebugAarMetadata as if they were the root cause; read the first metadata issue below them.Do not copy a compileSdk number from another developer's error; use the minimum stated by your dependency and a supported toolchain.Do not raise minSdk or targetSdk to satisfy a minCompileSdk requirement.Do not suppress/patch AAR metadata to force an incompatible library through the check.Do not upgrade or downgrade multiple toolchain components blindly; keep the compatibility change explainable.Do not edit generated Gradle/build output as the durable fix.Do not stop reading after the first numbered metadata issue; the same task can report multiple dependency/toolchain requirements that must be solved coherently.Do not assume every minCompileSdk increase requires an AGP upgrade; check the actual AGP/compile-SDK support boundary first.Do not assume the version declared in one build file is the effective version when convention plugins, catalogs, settings plugins or framework tooling can supply/override it.Do not keep diagnosing AAR metadata once the exact task passes and the build advances to resource linking, manifest merging, compilation or another failure stage.

Only seeing the task wrapper?

Expand the failed task in Android Studio Build Output and look immediately below the AAR metadata heading for the first numbered issue. If the IDE hides it, rerun the exact failing task shown in your build from the project root with more logging.

./gradlew :app:checkDebugAarMetadata --info # replace module/variant/task with the one from your own failure

If the task is :feature:checkReleaseAarMetadata, rerun that task instead. The goal is to expose the dependency requirement—not to generate the longest possible Gradle log.

Before escalating, capture:the exact failing task/module/variantthe complete numbered AAR metadata issue block for the failing module/variant, with the first concrete issue identifieddependency coordinates and versioneffective compileSdk, minSdk and targetSdkeffective AGP, Gradle and JDK versions actually used by the failing build, plus where each value is ownedcompile SDK extension if the issue names onethe dependency/toolchain change immediately before the failure

Official references

Still stuck? Ask the community

Share the first AAR metadata issue, dependency coordinates, failing module/variant, compileSdk and AGP version. The task name alone usually is not enough.

Keep it safe: redact private repository URLs, credentials, signing secrets, tokens and confidential source before posting.
Powered by GitHub DiscussionsSign in with GitHub to comment. Reading comments does not require sign-in.

Loading community discussion…