Pecana
Pecana

Reputation: 363

Android Studio 3.4 Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 14

after upgrading Android Studio to version 3.4 my project sync reports an error:

ERROR: Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 14 declared in library [androidx.legacy:legacy-support-v4:1.0.0] C:\Users\pecana\.gradle\caches\transforms-2\files-2.1\0b6817155f227f1df719b12aa7dc1519\AndroidManifest.xml as the library might be using APIs not available in 1
Suggestion: use a compatible library with a minSdk of at most 1,
    or increase this project's minSdk version to at least 14,
    or use tools:overrideLibrary="androidx.legacy.v4" to force usage (may lead to runtime failures)

I can by the way build the APK and run the application correctly (but only without instant run active). I tried to add the

<uses-sdk tools:overrideLibrary="androidx.legacy.v4"/>

to the main AndroidManifest.xml but the error still occurs. Any idea on how to fix this ?

Thank you

Upvotes: 3

Views: 4218

Answers (1)

Tamir Abutbul
Tamir Abutbul

Reputation: 7661

As the error suggested you can also increase your project's minSdk version to 14 or above.

Go to your build.gradle(Module app) file and add the minimum SDK version like this:

android {
compileSdkVersion 28
    defaultConfig {      
       minSdkVersion 14 or above here
    }      
}

Upvotes: 4

Related Questions