Flutter "minSdkVersion Cannot Be Smaller Than Version Declared in Library": The 4-Step Fix
What does "minSdkVersion cannot be smaller than version declared in library" mean in Flutter?
It means one of your plugins supports fewer Android versions than your app claims to, so Gradle refuses to merge the plugin's manifest into your app. The full error reads like "Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore]", followed by three suggestions. Your app's minimum Android API level (minSdk) is lower than the plugin's, and Android's build tools treat that as an error by default. The usual fix is to raise minSdk in android/app/build.gradle.kts to the number the error names. GSPTeck is giosaia's indie studio building mobile and web apps with Flutter and Firebase, and this guide was checked against the Android, Flutter and Gradle sources on 2026-11-28.
The minSdk Match: 4 steps to fix it
Short answer: read the two numbers in the error, decide whether you can drop the older Android versions, then set minSdk once in the app's Gradle file and rebuild.
- Read the error line. It names your current value, the plugin's value and the plugin, for example "minSdkVersion 21 cannot be smaller than version 26 declared in library [:some_plugin]". Note the second number and the plugin name.
- Decide if the cut is acceptable. Raising minSdk means devices below that API level can no longer install your app. If you must keep them, look for an older release of the plugin that supports a lower minimum, or a different plugin.
- Set
minSdkindefaultConfig. Inandroid/app/build.gradle.kts, replaceminSdk = flutter.minSdkVersionwith the number from the error, for exampleminSdk = 26. In an older Groovybuild.gradle, the line isminSdkVersion 26. If several plugins complain, use the highest number any of them needs, and don't go below Flutter's own default of 24. - Rebuild and check. Run
flutter build appbundle(orflutter run) again. The manifest merge passes once your minSdk is at least the plugin's.
If the same build keeps failing on the same plugin, check you edited android/app/, the app module, and not the project-level android/build.gradle.kts. The app module's defaultConfig is where Flutter's own docs show minSdk.
Why does Gradle refuse to build?
Short answer: Android's manifest merger stops when a library declares a higher minSdk than your app, because the library may call APIs your lowest supported Android version doesn't have.
Every Flutter plugin with Android code ships its own manifest. At build time, Android's manifest merger combines your app's manifest with each library's. Android's documentation says the merger normally keeps your app's values, with one exception that matters here: "When the lower-priority manifest has a minSdk value that's higher, an error occurs unless you apply the overrideLibrary merge rule."
The error text explains the risk in its own words: the library "might be using APIs not available" on your minimum version. On a phone running that older Android, such a call can crash at runtime, which is why the build fails early instead.
One more detail from the same Android page: the minSdk in your Gradle file overrides any <uses-sdk> element in AndroidManifest.xml. Google recommends leaving <uses-sdk> out of the manifest and setting these values only in Gradle, so there's one place to change.
What is Flutter's default minSdk now?
Short answer: 24 (Android 7.0). Flutter's Gradle plugin sets flutter.minSdkVersion to 24 in its current stable source, checked on 2026-11-28.
New Flutter projects don't hard-code a number. Their defaultConfig reads minSdk = flutter.minSdkVersion, and Flutter's docs explain that any value starting with flutter. comes from the Flutter Gradle plugin. Flutter's supported-platforms page lists Android API 24 to 37 as supported and 23 and earlier as unsupported.
That has two practical effects:
- Old projects may carry an old number. A project created years ago might still have a hard-coded
minSdkVersion 16or21. Modern plugins then trip the error even though a new project wouldn't. - Flutter upgrades can move the default. Flutter's docs note that you can replace the
flutter.variables with fixed integers if you want to stop the value changing when you upgrade Flutter.
| API level | Android version | What it means for a Flutter app (checked 2026-11-28) |
|---|---|---|
| 21 | Android 5.0 | Below Flutter's supported range |
| 23 | Android 6.0 | Listed as unsupported by Flutter |
| 24 | Android 7.0 | Flutter's current default minSdk and the lowest supported level |
| 26 | Android 8.0 | A common minimum for plugins that need newer APIs |
API level to version names come from Android's <uses-sdk> reference table.
Should you use tools:overrideLibrary instead?
Short answer: only if you've confirmed the plugin's newer APIs are never reached on older devices. The error itself warns that forcing it "may lead to runtime failures".
Android's docs describe the escape hatch: add tools:overrideLibrary with the library's package name to the <uses-sdk> tag in your app manifest, and the merger keeps your lower minSdk. The error message even prints the exact package name to use.
| Option | What changes | Risk | Choose it if |
|---|---|---|---|
| Raise minSdk | Devices below the new level can't install the app | Smaller device reach | You can drop those Android versions (the normal choice) |
| Older plugin version | You stay on a release that supports your minimum | Missing fixes and features | You must keep older devices for now |
| tools:overrideLibrary | The merge is forced to pass | Crashes on old devices if the plugin calls newer APIs | You've guarded every call path yourself |
For most indie apps the first row is the honest answer. Android's <uses-sdk> reference explains that the system prevents installation on a device whose API level is lower than the app's minSdk, so raising it is a clean cut rather than a hidden crash.
What changes for users on Google Play after you raise minSdk?
Short answer: devices below your new minSdk can't install or update to the new release. People who already have an older version keep it, but they stop receiving updates. If an older plugin then fails with a different Gradle error, see the Namespace not specified error after an AGP 8 upgrade.
Flutter's own fix message spells this out: after the change, "your app will not be available to users running Android SDKs below" the new value. Before you ship, compare the new minimum with your audience, and add a note to your release checklist. Our Flutter and Firebase release checklist for Google Play has a slot for exactly this kind of build change.
If the build passes but the release behaves differently from debug, the next stop is our list of reasons a Flutter app works in debug but not in release. If you're also raising targetSdk for Play's yearly requirement, keep that separate: target and minimum are different settings, covered in our Flutter Android 16 (API 36) upgrade guide. Firebase plugins such as cloud_firestore have triggered this error in the past, and our guide to the Firebase "No App '[DEFAULT]' has been created" error covers the next setup error people usually hit.
We build and ship our own Flutter apps on Google Play, so the same four steps run on GSPTeck's apps whenever a plugin raises its minimum.
FAQ
Where do I change minSdk in a Flutter project?
In android/app/build.gradle.kts (or build.gradle in older projects), inside android { defaultConfig { ... } }. Replace flutter.minSdkVersion with the number the error asks for.
Is minSdkVersion the same as minSdk?
Yes, they set the same value. minSdk is the property name in current Android Gradle files, and minSdkVersion is the older Groovy and manifest name.
Will raising minSdk remove my app from older phones?
New installs and updates stop on devices below the new level. Existing installs stay on those phones but don't get the new release.
Why didn't flutter.minSdkVersion fix it automatically?
Because the plugin needs a higher number than Flutter's default, or your project replaced the variable with an older fixed number. Set the value the error names.
Sources
- Android Developers: Manage manifest files, merge rules and overrideLibrary (checked 2026-11-28)
- Android Developers: the uses-sdk element and API levels (checked 2026-11-28)
- Flutter docs: Build and release an Android app, Android SDK versions (checked 2026-11-28)
- Flutter docs: Supported deployment platforms (checked 2026-11-28)
- Flutter source: FlutterExtension.kt default minSdkVersion (checked 2026-11-28)
- Flutter GitHub issue #132051: the full manifest merger error and Flutter Fix message (checked 2026-11-28)