Execution failed for task ':app:processDebugManifest'

Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
    is also present at [com.android.support:support-v4:26.0.0-alpha1] AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
    Suggestion: add 'tools:replace="android:value"' to  element at AndroidManifest.xml:25:5-27:34 to override.

项目引用第三方库的时候出现了版本冲突,解决方法如下:
在app的bulid.gradle文件最下方添加以下代码:

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

你可能感兴趣的:(导入第三方库,编译)