How to Solve 'Manifest merger failed' erro

2019-07-18 12:35发布

问题:

Error from androidmanifest.xml :

Execution failed for task ':app:processDebugManifest' Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 7 declared in library [com.android.support:appcompat-v7:23.2.0] C:\Users\bsuni\AndroidStudioProjects\Rec\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.2.0\AndroidManifest.xml Suggestion: use tools:overrideLibrary="android.support.v7.appcompat" to force usage

回答1:

I have regenerate this error :

You have selected minSdkVersion to 1 while you created project.

as well as you are using :

compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'

due to this error occurs.

suggestion by android-studio :

use android.support.v7.appcompat

solution : change in gradle

minSdkVersion 7


回答2:

    configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
    def requested = details.requested
    if (requested.group == 'com.android.support') {
        if (!requested.name.startsWith("multidex")) {
            details.useVersion '26.0.2'
        }
    }
} 

}

NOTE :Add this to your build.gradle and make sure you are using the same versions as '26.0.2'.