minSdkVersion cannot be smaller than the library's Flutter / Dart Origin: On your device Last updated 4 Nov 2026

Android Gradle: uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:firebase_auth]

A plugin requires a higher Android minimum SDK than your app declares.

Exact message you may see uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in libraryManifest merger failed : uses-sdk:minSdkVersion cannot be smaller than version declared in libraryminSdkVersion cannot be smaller than version 23 declared in librarySuggestion: use a compatible library with a minSdk of at most 16
Seen on: Flutter Android

Meaning

Raise minSdkVersion in android/app/build.gradle (or use flutter.minSdkVersion if the Flutter default is high enough). Check the plugin's README for its required minimum, then clean and rebuild.

Common causes

  • Default minSdk lower than plugin requirement
  • Old project template with minSdkVersion 16/19
  • Plugin upgrade raised its minimum
  • Manifest merger conflict
  • Hard-coded value in build.gradle

⚡ Quick fix

  1. Set minSdkVersion 21 (or the version in the error) in defaultConfig
  2. Run flutter clean and rebuild
  3. Check each plugin's required minSdk

Detailed fix by platform

Android

  1. In android/app/build.gradle: defaultConfig { minSdkVersion 23 } (Kotlin DSL: minSdk = 23)

How to diagnose

  1. Required — Version in the message?
  2. File — app/build.gradle edited?
  3. Clean — Rebuilt?

🔧 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):

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…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…Dependency requires compileSdk 34 or later — 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 (Flutter / Dart)Dependency requires c…Gradle task assembleDebug failed with exit code 1 — Flutter: Exception: Gradle task assembleDebug failed with exit code 1 (Flutter / Dart)Gradle task assembleD…PlatformException(sign_in_failed, ApiException: 10) — Flutter: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) (Flutter / Dart)PlatformException(sig…Unsupported class file major version (Gradle / Java) — Android Gradle: Execution failed — Unsupported class file major version 65 / Android Gradle plugin requires Java 17 to run (Flutter / Dart)Unsupported class fil…minSdkVer…

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.