Dependency requires compileSdk 34 or later Flutter / Dart Origin: On your device OSI layer 7 · Application Last updated 4 Nov 2026

Android Gradle: Execution failed for task ':app:checkDebugAarMetadata'. Dependency requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs

A dependency was built against a newer Android API than your project's compileSdk.

Exact message you may see Execution failed for task ':app:checkDebugAarMetadata'Dependency requires libraries and applications that depend on it to compile against version 34 or later of the Android APIscompileSdkVersion is currently 31 requires compile against version 33
Seen on: Flutter Android

Meaning

Set compileSdk (and usually targetSdk) to the required version in android/app/build.gradle or use flutter.compileSdkVersion after upgrading Flutter. Install that SDK platform in the SDK Manager.

Common causes

  • compileSdk lower than the plugin's requirement
  • Hard-coded compileSdkVersion in build.gradle
  • SDK platform not installed
  • Plugin upgrade bumped its API level
  • Flutter not upgraded

⚡ Quick fix

  1. Set compileSdk 34 (or required) in android/app/build.gradle
  2. Install the matching Android SDK Platform
  3. Upgrade Flutter so flutter.compileSdkVersion is current

Detailed fix by platform

Android

  1. In android {}: compileSdk = 34 (Kotlin DSL) or compileSdkVersion 34 (Groovy)

How to diagnose

  1. Required — API in the message?
  2. Installed — SDK platform present?
  3. File — build.gradle updated?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

A Timer is still pending even after the widget tree was disposed — Flutter test: A Timer is still pending even after the widget tree was disposed (Flutter / Dart)A Timer is still pend…Android license status unknown / licenses not accepted — flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses (Flutter / Dart)Android license statu…Android resource linking failed — AAPT: error: resource x (aka y) not found — Android resource linking failed (Android)Android resource link…android:attr/lStar not found — AAPT: error: resource android:attr/lStar not found (Android)android:attr/lStar no…BoxConstraints forces an infinite width — Flutter: BoxConstraints forces an infinite width. These invalid constraints were provided to RenderStack's layout() function (TextField in a Row) (Flutter / Dart)BoxConstraints forces…Cannot fit requested classes in a single dex file — Cannot fit requested classes in a single dex file (# methods: 65536 > 65536) — mergeDex failed (Android)Cannot fit requested …Cleartext HTTP traffic not permitted — Flutter (Android): java.io.IOException: Cleartext HTTP traffic to api.example.com not permitted (Flutter / Dart)Cleartext HTTP traffi…cmdline-tools component is missing — flutter doctor: Android SDK is missing command-line tools; download from https://goo.gl/XxQghQ — cmdline-tools component is missing (Flutter / Dart)cmdline-tools compone…Dependenc…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.