2017-08-14 114 views
-4

我试图recyclerView添加到Android的依赖,但补充说,库后产生这个错误清单合并失败

Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute meta-data#[email protected] 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:recyclerview-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.

我已经通过项目结构

+0

show'manifest.xml' –

+0

错误:执行任务':app:processDebugManifest'失败。 > Manifest合并失败:属性meta-data#[email protected] value =(25.3.1)from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31 \t也出现在[com.android.support:recyclerview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38 value =(26.0.0-alpha1)。 \t建议:在AndroidManifest.xml:25:5-27:34处添加'tools:replace =“android:value”'至元素以覆盖。 –

+0

什么是错误sar?先发好你的清单并记录下来。 – sector11

回答

0

更改您的build.gradle添加它(应用程序)至

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.1" 
    useLibrary 'org.apache.http.legacy' 
    defaultConfig { 
     applicationId "PACKAGE NAME" 
     minSdkVersion 15 
     targetSdkVersion 26 
     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(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:appcompat-v7:26.+' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:recyclerview-v7:26.+' 
    compile 'com.android.support:cardview-v7:26.+' 
    compile 'com.android.support:design:26.+' 
    compile 'com.android.support:support-v4:26.+' 
    testCompile 'junit:junit:4.12' 
} 
+0

他的错误是有关最maf标记覆盖 data#[email protected]值=(25.3.1)如何解决我不知道 – sector11

+0

使用+不推荐 – sector11

+0

这对我的工作感谢。我将appcompact和recycleview的版本更改为26. +并将编译sdk的版本更改为26,然后修复了错误 –

0

当您包含对具有不同版本号的多个库或模块的引用时,会发生此错误。所以保持同步所有观点库版本号

+0

你可以解释更多 –

+0

你可以在这里发布你的build.gradle(从应用程序模块)文件吗? –

+0

无论哪种解决方案适用于您,请将其标记为接受的答案。 –

0

请确保所有支持库的版本是一样的:

build.gradle项目层面不app/水平添加这些行

ext { 
    supportLibrary = '26.0.0' // your support library version goes here 
} 

,然后添加在那里所有的Android依赖声明这个给你项目级别:

implementation "com.android.support:appcompat-v7:${rootProject.supportLibrary}"

如果您使用的是某个元标记,则使AndroidManifest与此类似

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    package="my.supercool.app"> 


    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     **tools:replace="android:value"** 
     android:roundIcon="@mipmap/ic_launcher_round" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 
</application> 

... 
</manifest> 

工具取代实际上解决了压倒一切的元标签值的错误消息。