【问题标题】:Manifest merger failed while adding FirebaseUI library and support libraries添加 FirebaseUI 库和支持库时清单合并失败
【发布时间】:2018-03-11 15:56:27
【问题描述】:

我正在使用 google firebase 实施身份验证。我收到此错误。如果可能的话,请有人提出解决方案和解释,以便我理解。

错误:任务 ':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:appcompat-v7:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0)。 建议:将 'tools:replace="android:value"' 添加到 AndroidManifest.xml:26:9-28:38 的元素以覆盖。

以下是我的 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'

【问题讨论】:

    标签: android android-studio firebase firebase-authentication firebaseui


    【解决方案1】:

    在清单中的应用程序标签内添加这一行

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

    如上所示。这不是你的整数目录,它是一个 Android 目录。

    【讨论】:

      【解决方案2】:

      您可以在official doc:中找到

      如果您想使用 FirebaseUI 的传递依赖项之一的较新版本,例如 Firebase、Play 服务或 Android 支持库,您需要在 build.gradle 中为所有FirebaseUI 的依赖项 在您要使用的版本。

      对于 Auth,您必须在 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"
      

      【讨论】:

        猜你喜欢
        • 2018-02-18
        • 2020-01-26
        • 1970-01-01
        • 1970-01-01
        • 2018-03-15
        • 1970-01-01
        • 1970-01-01
        • 2017-12-28
        • 1970-01-01
        相关资源
        最近更新 更多