清单合并因 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'
清单不同步,错误信息如下:
错误:清单合并失败:来自 [com.android.support:support-compat:28.0.0] 的属性 application@appComponentFactory 值=(android.support.v4.app.CoreComponentFactory) AndroidManifest.xml:22:18-91
也存在于 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory)。
建议:将 'tools:replace="android:appComponentFactory"' 添加到位于 AndroidManifest.xml:7:5-25:19 的元素以覆盖。
我的清单文档:
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'
我刚刚遇到了和你一样的问题。这就是我解决它的方法。你可以试试看:(我用的是2019最新的android版本)
我改变这个:
implementation 'com.google.firebase:firebase-core:17.0.0'
实施'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 数据库。我想我们应该这样:
implementation 'com.google.firebase:firebase-database:16.0.4'
而不是遵循 Firebase 文档中的介绍。
希望对你有用
Firebase 在最新版本中迁移到了 AndroidX。
这意味着您同时使用了支持库和 androidx 库。
您可以:
- 如下所述迁移到 androidx
- 降级你的 firebase 依赖项(但这不是真正的解决方案,因为你必须在之前或之后迁移)
您可以查看 official release notes:
Warning: This release is a MAJOR version update and breaking change.
The latest update to Google Play services and Firebase includes the following changes:
从 Android 支持库迁移到 Jetpack (AndroidX) 库。除非您在应用中进行以下更改,否则库将无法工作:
- 将
com.android.tools.build:gradle
升级到 v3.2.1 或更高版本。
- 将
compileSdkVersion
升级到 28 或更高版本。
- 更新您的应用程序以使用 Jetpack (AndroidX);按照 Migrating to AndroidX.
中的说明进行操作
您的 firebase 版本不兼容。您可以检查最新版本的兼容性,也可以使用此
implementation 'com.google.firebase:firebase-firestore:19.0.2'
implementation 'com.google.firebase:firebase-auth:17.0.0'
当我实施时
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
清单不同步,错误信息如下:
错误:清单合并失败:来自 [com.android.support:support-compat:28.0.0] 的属性 application@appComponentFactory 值=(android.support.v4.app.CoreComponentFactory) AndroidManifest.xml:22:18-91 也存在于 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory)。 建议:将 'tools:replace="android:appComponentFactory"' 添加到位于 AndroidManifest.xml:7:5-25:19 的元素以覆盖。
我的清单文档:
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'
我刚刚遇到了和你一样的问题。这就是我解决它的方法。你可以试试看:(我用的是2019最新的android版本) 我改变这个:
implementation 'com.google.firebase:firebase-core:17.0.0'
实施'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 数据库。我想我们应该这样:
implementation 'com.google.firebase:firebase-database:16.0.4'
而不是遵循 Firebase 文档中的介绍。 希望对你有用
Firebase 在最新版本中迁移到了 AndroidX。 这意味着您同时使用了支持库和 androidx 库。
您可以:
- 如下所述迁移到 androidx
- 降级你的 firebase 依赖项(但这不是真正的解决方案,因为你必须在之前或之后迁移)
您可以查看 official release notes:
Warning: This release is a MAJOR version update and breaking change. The latest update to Google Play services and Firebase includes the following changes:
从 Android 支持库迁移到 Jetpack (AndroidX) 库。除非您在应用中进行以下更改,否则库将无法工作:
- 将
com.android.tools.build:gradle
升级到 v3.2.1 或更高版本。 - 将
compileSdkVersion
升级到 28 或更高版本。 - 更新您的应用程序以使用 Jetpack (AndroidX);按照 Migrating to AndroidX. 中的说明进行操作
您的 firebase 版本不兼容。您可以检查最新版本的兼容性,也可以使用此
implementation 'com.google.firebase:firebase-firestore:19.0.2'
implementation 'com.google.firebase:firebase-auth:17.0.0'