1

我正在使用Google Firebase實施身份驗證。我收到這個錯誤。如果可能的話,請有人建議解決方案和解釋,所以我可以理解。在添加FirebaseUI庫和支持庫時清單合併失敗

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

下面是我的gradle這個文件

1.項目模塊

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 
     classpath 'com.google.gms:google-services:3.1.0' 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url "https://maven.google.com" 
     } 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

2,模塊應用

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.1" 
    defaultConfig { 
     applicationId "com.example.prerak.final_audio_streamer" 
     minSdkVersion 19 
     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.google.firebase:firebase-ads:11.4.0'//advertisements 

    compile 'com.firebaseui:firebase-ui-auth:2.4.0'// FirebaseUI Auth only 
    compile'com.google.firebase:firebase-auth:11.4.0'//firebase auth 
    compile 'com.google.android.gms:play-services:11.4.0'//playservice 


    testCompile 'junit:junit:4.12' 
} 
apply plugin: 'com.google.gms.google-services' 

回答

0

加入這一行你的應用程序標籤內的艙單

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" 
     tools:replace="android:value" /> 

完全如上所示。這不是你的整數目錄,它是一個Android目錄。

0

您可以在official doc:

If you would like to use a newer version of one of FirebaseUI's transitive dependencies, such as Firebase, Play services, or the Android support libraries, you need to add explicit compile declarations in your build.gradle for all of FirebaseUI's dependencies at the version you want to use.

在認證找你必須在你的build.gradle加上這些行:

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