Android "uses-sdk:minSdkVersion ... cannot be smaller" in CI
A library in your dependency graph declares a higher minSdkVersion than your app does. The manifest merger refuses to lower the library’s requirement, so the build fails.
What this error means
The Android build fails in manifest merging with "uses-sdk:minSdkVersion X cannot be smaller than version Y declared in library". It is deterministic - a dependency simply needs a newer Android than your app targets.
Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than
version 24 declared in library [androidx.some:lib:1.0.0]
Suggestion: use a compatible library with a minSdk of at most 21.Common causes
A dependency requires a higher minSdk
A library bumped its minimum Android version. Your app’s lower minSdkVersion is incompatible, and the merger will not silently weaken the library’s contract.
App minSdk set lower than the ecosystem
Targeting a very old minSdkVersion increasingly conflicts with modern AndroidX/Compose libraries that have moved their floor up.
How to fix it
Raise the app minSdkVersion
If you can drop support for the oldest devices, raise minSdk to satisfy the library.
// app/build.gradle(.kts)
android {
defaultConfig {
minSdk = 24
}
}Use a compatible library version
- Check whether an older release of the library still supports your
minSdk. - Pin to that version, or replace the dependency with one that targets a lower floor.
- As a last resort, override with
tools:overrideLibraryonly if you fully understand the runtime risk.
How to prevent it
- Keep
minSdkVersionaligned with the libraries you depend on. - Review minSdk requirements when upgrading AndroidX/Compose.
- Pin dependency versions so a transitive bump cannot move the floor unexpectedly.