Manifest merger failed : Attribute meta-data#[email protected] value=(26.0.1)

备注:本文参考文章:https://blog.csdn.net/jiyilidenapianhai/article/details/79959052?utm_source=blogxgwz6

异常具体信息:

Manifest merger failed : Attribute meta-data#[email protected] value=(26.0.1) from [com.android.support:cardview-v7:26.0.1] AndroidManifest.xml:25:13-35
    is also present at [com.android.support:design:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:23:9-25:38 to override.

解决思路:

经验说明:以上信息是因为引入包的版本不一致导致的

第一步:

   全局查找(快捷键Ctrl+H,android Studio使用的是eclipse的快捷键模式):

   com.android.support:design:26.1.0,经过查找应该是在build.gradle文件中;

第二步:

  项目的buidl.gradle的内容如下:

dependencies {
    implementation fileTree(include: ['*.jar'], exclude: ['org.simalliance.openmobileapi.jar'], dir: 'libs')
    implementation 'com.android.support:cardview-v7:26.0.1'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    implementation 'org.greenrobot:greendao:3.2.2'
    implementation 'com.android.support:design:26.1.0'
    implementation project(':emotionrain')
    implementation 'com.android.support:support-annotations:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'android.arch.lifecycle:extensions:1.1.1'
}

可以看出cardview和design、support-annotations的版本不一致,所以修改三个的版本为一样的即可。

经过参考网文,自己摸索解决后书写的文章,望对各位有帮助。

点赞