任务执行失败:app:processDebugManifest Android Studio 2.3.3。

3

在添加和依赖后,我遇到了编译错误。我已经检查过每篇帖子,但似乎没有解决这个问题的人。

错误:

Error: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:cardview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38 value=(26.0.0-alpha1). Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:25:5-27:34 to override.

我的Build.Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.soft.kukito.cardviewprueba"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:cardview-v7:26.0.0-alpha1'
    compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
}

感谢大家的回答。
1个回答

6
您需要使用相同的Android支持库版本。 您需要使用支持库 26.0.0-alpha1 版本。 因此请更改以下内容:
compile 'com.android.support:appcompat-v7:25.3.1'

为了

compile 'com.android.support:appcompat-v7:26.0.0-alpha1'

您还需要将compileSdkVersiontargetSdkVersion更改为26版本。


如果我更改了它,例如在编译后在Lollipop中是否有效? - AtarC5
它将支持您在minSdkVersion中设置的最低SDK版本。在您的情况下,您使用的是minSdkVersion 21targetSdkVersion 25,这告诉Android Studio构建项目以支持Android Lollipop(5.0)到Android 7.1。 - ישו אוהב אותך

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接