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.
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 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
- Set
minSdkVersion 21(or the version in the error) indefaultConfig - Run
flutter cleanand rebuild - Check each plugin's required minSdk
Detailed fix by platform
Android
- In
android/app/build.gradle:defaultConfig { minSdkVersion 23 }(Kotlin DSL:minSdk = 23)
How to diagnose
- Required — Version in the message?
- File — app/build.gradle edited?
- 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:
Similar errors
- Android license status unknown / licenses not accepted flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses
- Cleartext HTTP traffic not permitted Flutter (Android): java.io.IOException: Cleartext HTTP traffic to api.example.com not permitted
- 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
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