Android:在我为项目进行评分时出现清单合并错误

时间:2018-04-10 07:04:05

标签: android android-studio

错误:任务':app:processDebugManifest'执行失败。

  

清单合并失败:[com.android.support:design:26.0.1] AndroidManifest.xml:28:13-35中的属性meta-data#android.support.VERSION@value value =(26.0.1)       也出现在[com.android.support:recyclerview-v7:26.1.0] AndroidManifest.xml:25:13-35 value =(26.1.0)。       建议:在AndroidManifest.xml:26:9-28:38中添加'tools:replace =“android:value”'以覆盖。

和build.gradle文件是

  android { compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.example.bhatti.testapplication"
        minSdkVersion 14
        targetSdkVersion 26
        multiDexEnabled = true
        jackOptions {
            enabled true}
       ...}
    ....} compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }}

     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 project(':chat-sdk-ui')
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:recyclerview-v7:26.+'
    testCompile 'junit:junit:4.12'
        compile 'com.google.android.gms:play-services:10.2.6'
}
apply plugin: 'com.google.gms.google-services'

2 个答案:

答案 0 :(得分:0)

对所有dependencies

使用相同的SDK版本
 android { compileSdkVersion 27
            defaultConfig {
            applicationId "com.example.bhatti.testapplication"
            minSdkVersion 15
            targetSdkVersion 27
            multiDexEnabled = true
            jackOptions {
                enabled true}
           ...}
        ....} compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }}

         dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        implementation project(':chat-sdk-ui')
        implementation 'com.android.support:appcompat-v7:27.1.0'
        implementation 'com.android.support.constraint:constraint-layout:1.0.2'
        implementation 'com.android.support:recyclerview-v7:27.1.0'
        testCompile 'junit:junit:4.12'
        implementation 'com.google.android.gms:play-services:12.0.1'
    }
    apply plugin: 'com.google.gms.google-services'

答案 1 :(得分:0)

变化

compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'

com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'