Android development
manifest merger
minSdkVersion
mobile app development
Android troubleshooting

Manifest merger failed uses-sdkminSdkVersion 14

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

The Android error about manifest merger and uses-sdk:minSdkVersion usually appears when one library requires a higher API level than your app declares. This is a build-time compatibility check, not a random Gradle glitch. The right fix is to align dependency requirements with your supported device strategy instead of suppressing the error.

How Manifest Merger Works

During build, Android merges manifests from:

  • your app module
  • build type and product flavor overlays
  • all AAR dependencies and transitive libraries

If any dependency declares a minimum SDK above your app minimum, merger fails because final manifest cannot represent contradictory requirements.

You can inspect exact conflict origin in Android Studio through the Merged Manifest view, which shows where each attribute was contributed.

Typical Conflict Scenario

App declares minSdk 14, but imported library supports only API 21 and above.

gradle
1android {
2    compileSdk 35
3
4    defaultConfig {
5        applicationId "com.example.app"
6        minSdk 14
7        targetSdk 35
8    }
9}
10
11dependencies {
12    implementation "androidx.work:work-runtime-ktx:2.10.0"
13}

If the dependency requires API 21, build fails with min SDK mismatch message.

Preferred Resolution Paths

The correct approach depends on product requirements.

Raise app minimum SDK

If business no longer supports old devices, raising app minSdk is cleanest.

gradle
defaultConfig {
    minSdk 21
}

Downgrade or replace dependency

If supporting API 14 is still mandatory, choose dependency versions that explicitly support it, or use alternative libraries.

Feature partitioning

Sometimes only one feature needs newer API support. Move that feature into a separate module or guarded flow and keep core app compatible.

Avoid Blind tools:overrideLibrary

tools:overrideLibrary can bypass merger checks, but it can also ship app builds that crash at runtime on old devices.

xml
1<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2    xmlns:tools="http://schemas.android.com/tools">
3
4    <uses-sdk
5        android:minSdkVersion="14"
6        tools:overrideLibrary="com.example.highminsdk" />
7</manifest>

Only use this when you audited library behavior and proved with device testing that unsupported APIs are never executed on lower versions.

Debugging Workflow That Saves Time

A repeatable triage flow prevents guesswork:

  1. Read the full Gradle output and identify conflicting library package name.
  2. Open Merged Manifest and inspect uses-sdk contributors.
  3. Run dependency tree to find transitive source.
  4. Decide whether to raise min SDK or swap dependency.
  5. Rebuild and test on lowest supported emulator.

Dependency insight command:

bash
./gradlew :app:dependencies

This helps confirm whether conflict came from direct or nested dependency.

Flavor Specific Strategies

If your app has flavors with different device targets, set minSdk per flavor instead of one global value.

gradle
1android {
2    productFlavors {
3        legacy {
4            minSdk 16
5        }
6        modern {
7            minSdk 24
8        }
9    }
10}

This approach can keep broader compatibility for one distribution while allowing modern APIs in another.

Runtime Guarding for Optional APIs

Even with compatible dependencies, your own code must guard newer APIs.

kotlin
1if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
2    // use modern API path
3} else {
4    // fallback path
5}

Manifest and runtime checks work together. Passing merge does not guarantee runtime safety.

CI and Release Discipline

Add one CI build variant that uses your lowest supported SDK emulator or instrumentation environment. Many teams catch min SDK regressions too late because CI builds only on modern API levels.

For dependency updates, include an automated report in pull requests showing changed minSdk expectations where possible.

Common Pitfalls

  • Using tools:overrideLibrary for quick build success without validating runtime API safety.
  • Inspecting only direct dependencies while transitive dependencies cause the real min SDK conflict.
  • Forgetting flavor-specific minSdk declarations and misreading which variant is failing.
  • Updating libraries without testing on the lowest supported API level in CI.
  • Ignoring stale Gradle caches after dependency changes and debugging outdated artifacts.

Summary

  • This merger error signals a real API compatibility mismatch.
  • Use merged manifest and dependency tree output to find the exact source.
  • Prefer raising minSdk or choosing compatible libraries over bypass directives.
  • Use flavor-specific SDK targets when product strategy requires multiple device tiers.
  • Validate on lowest supported runtime to prevent build-success and runtime-failure gaps.

Course illustration
Course illustration

All Rights Reserved.