radders
radders

Reputation: 923

Manifest merger failed error during build

I'm trying to build an app for API 7 which is the device I need to run it on. I've set the minSDK to 7, and added the following:

<uses-sdk
    android:minSdkVersion="7"
    android:targetSdkVersion="19"
    tools:ignore="OldTargetApi"
    tools:overrideLibrary="android.support.test.espresso,
                           android.support.v7.appcompat,
                           android.support.v4,
                           android.support.mediacompat,
                           android.support.fragment,
                           android.support.coreui,
                           android.support.coreutils,
                           android.support.graphics.drawable,
                           android.support.compat">
</uses-sdk>

However, during the (gradle) build I get the following error:

Error:Execution failed for task ':app:processDebugAndroidTestManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 7 cannot be smaller than version 8 declared in library [com.android.support.test.espresso:espresso-core:2.2.2] C:\Users\david\.android\build-cache\828bf92787e99464e08501328373b997b66ab556\output\AndroidManifest.xml
    Suggestion: use tools:overrideLibrary="android.support.test.espresso" to force usage

Everything worked fine until I set the min sdk to 7 (it was 26).

What else do I have to do to get this to build? Thanks

Upvotes: 1

Views: 108

Answers (3)

radders
radders

Reputation: 923

Ok, this issue is resolved. As advised, I removed the reference to espresso, and found a solution to Dex problem on SO. Thanks to all who replied.

Upvotes: 0

ישו אוהב אותך
ישו אוהב אותך

Reputation: 29804

If your android:minSdkVersion="7" is a mandatory, you can try using the old version of espresso in your app build.gradle with the following dependencies:

 androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'

You can found the version list in Testing Library Support Release Notes

Upvotes: 2

Don Chakkappan
Don Chakkappan

Reputation: 7560

uses-sdk:minSdkVersion 7 cannot be smaller than version 8 declared in library

Your error is perfectly clear.Some of your included libraries configured to use with Minimum of SDK version 8.

Please downgrade the libraries to 7 or upgrade your App to 8.

Upvotes: 0

Related Questions