清单同步错误

时间:2017-12-09 11:33:40

标签: android gradle android-gradle android-manifest

我想在4个月后回去继续我的Android应用程序,发生的事情是该清单没有与以下错误同步:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.1.0) from [com.android.support:support-v13:26.1.0] AndroidManifest.xml:28:13-35
    is also present at [com.android.support:design:26.0.1] AndroidManifest.xml:28:13-35 value=(26.0.1).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.

我的清单是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.arnick.bazim"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 7
        versionName "0.9.5"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        manifestPlaceholders = [onesignal_app_id               : #the one signal app id,

                                onesignal_google_project_number: "REMOTE"]
    }
    applicationVariants.all { variant ->
        variant.resValue "string", "versionName", variant.versionName
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:support-v13:26.1.0'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:cardview-v7:26.0.1'
    compile 'com.android.support:design:26.0.1'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:customtabs:26.1.0'
    compile 'com.google.firebase:firebase-auth:11.6.2'
    compile 'com.google.android.gms:play-services-auth:11.6.2'

    compile('io.socket:socket.io-client:1.0.0') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }
    compile 'com.onesignal:OneSignal:3.6.5'
    compile 'com.android.volley:volley:1.0.0'


    testCompile 'junit:junit:4.12'
}

如果重要,我使用的是本地gralde版本4.2.1 我还检查了gradle 4.3.1和非本地gradle,但错误仍然存​​在。 有什么我想念的吗? 我记得大约5个月前我猜到了我遇到了同样的问题,这与someignal版本有关,但我不记得发生了什么我知道我改变了版本并且错误消失了。

2 个答案:

答案 0 :(得分:0)

使用与gradle文件 26.0.2

顶部相同的版本
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.arnick.bazim"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 7
        versionName "0.9.5"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        manifestPlaceholders = [onesignal_app_id               : #the one signal app id,

                                onesignal_google_project_number: "REMOTE"]
    }
    applicationVariants.all { variant ->
        variant.resValue "string", "versionName", variant.versionName
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:support-v13:26.0.2'
    compile 'com.android.support:appcompat-v7:26.0.2'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:cardview-v7:26.0.2'
    compile 'com.android.support:design:26.0.2'
    compile 'com.android.support:support-v4:26.0.2'
    compile 'com.android.support:customtabs:26.0.2'
    compile 'com.google.firebase:firebase-auth:11.6.2'
    compile 'com.google.android.gms:play-services-auth:11.6.2'

    compile('io.socket:socket.io-client:1.0.0') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }
    compile 'com.onesignal:OneSignal:3.6.5'
    compile 'com.android.volley:volley:1.0.0'


    testCompile 'junit:junit:4.12'
}

清理和重建这可能会有所帮助......

答案 1 :(得分:0)

使用相同版本的支持库

更改

compile 'com.android.support:cardview-v7:26.0.1'
compile 'com.android.support:design:26.0.1'

compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'