Flutter "minSdkVersion Cannot Be Smaller Than Version Declared in Library": The 4-Step Fix

By · Published 2026-11-28 · Last verified 2026-11-28

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.

Grid of the 4-step minSdk Match: read your value and the library's value, decide whether to drop older Android versions, set minSdk in android/app, rebuild with flutter build appbundle, noting Flutter's default minSdk of 24 and avoiding overrideLibrary unless guarded
The 4-step minSdk Match for the manifest merger error.

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.

  1. 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.
  2. 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.
  3. Set minSdk in defaultConfig. In android/app/build.gradle.kts, replace minSdk = flutter.minSdkVersion with the number from the error, for example minSdk = 26. In an older Groovy build.gradle, the line is minSdkVersion 26. If several plugins complain, use the highest number any of them needs, and don't go below Flutter's own default of 24.
  4. Rebuild and check. Run flutter build appbundle (or flutter 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.

Two columns comparing raising minSdk, a clean cut where old devices can't install and the plugin works as built, with tools:overrideLibrary, where the build passes but the plugin may call newer APIs and crash on old devices
Raise minSdk or force the merge with overrideLibrary.

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:

API levelAndroid versionWhat it means for a Flutter app (checked 2026-11-28)
21Android 5.0Below Flutter's supported range
23Android 6.0Listed as unsupported by Flutter
24Android 7.0Flutter's current default minSdk and the lowest supported level
26Android 8.0A 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.

OptionWhat changesRiskChoose it if
Raise minSdkDevices below the new level can't install the appSmaller device reachYou can drop those Android versions (the normal choice)
Older plugin versionYou stay on a release that supports your minimumMissing fixes and featuresYou must keep older devices for now
tools:overrideLibraryThe merge is forced to passCrashes on old devices if the plugin calls newer APIsYou'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.

Four-step flow of the conflict: your app declares minSdk 21, a plugin declares minSdk 23, the manifest merger reports an error because the library is higher, and the fix raises the app to 23 or higher
Why Gradle stops the build.

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

Vertical Pinterest graphic with five points on the Flutter minSdkVersion cannot be smaller than library error
Pinterest pin: the Flutter minSdkVersion error.