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.
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 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
- Set
compileSdk 34(or required) inandroid/app/build.gradle - Install the matching Android SDK Platform
- Upgrade Flutter so
flutter.compileSdkVersionis current
Detailed fix by platform
Android
- In
android {}:compileSdk = 34(Kotlin DSL) orcompileSdkVersion 34(Groovy)
How to diagnose
- Required — API in the message?
- Installed — SDK platform present?
- 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:
Similar errors
- 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
- Android license status unknown / licenses not accepted flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses
- Android resource linking failed AAPT: error: resource x (aka y) not found — Android resource linking failed
Most viewed in Flutter / Dart
- setState() called after dispose() Flutter: setState() called after dispose(): _MyState#1a2b3 (lifecycle state: defunct, not mounted)
- A RenderFlex overflowed Flutter: A RenderFlex overflowed by x pixels on the right/bottom
- Null check operator used on a null value Dart/Flutter: Null check operator used on a null value
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 4 Nov 2026