清单合并因Firebase Auth失败 [英] Manifest merger failed with Firebase Auth
问题描述
当我实现
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
清单不同步,错误消息如下:
The Manifest not Sync, Error message like this:
错误:清单合并失败:来自[com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-的属性application @ appComponentFactory value =(android.support.v4.app.CoreComponentFactory) 91 也存在于[androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value =(androidx.core.app.CoreComponentFactory). 建议:在AndroidManifest.xml:7:5-25:19的元素上添加'tools:replace ="android:appComponentFactory"'以进行覆盖.
ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:7:5-25:19 to override.
我的清单文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.gokhanyilmaz.appseriestracker"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
推荐答案
我刚刚遇到了和您一样的问题.这就是我解决的方法.您可以尝试:(我使用的是最新的Android版本2019) 我将其更改为:
I just got the same problem like you. And this is how I solve it. You can try it: (i'm using newest android version of 2019) I change this:
implementation 'com.google.firebase:firebase-core:17.0.0'
实现'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
对此:
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.5'
,如果您想实现Firebase数据库.我认为我们应该这样做:
and if you you want to implement firebase database. I think we should you this:
implementation 'com.google.firebase:firebase-database:16.0.4'
代替在Firebase文档上进行以下介绍. 希望它对您有用
Instead of following introduction on Firebase Documentation. Hope it work for you
这篇关于清单合并因Firebase Auth失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!