如何解决“清单合并错误"?由于Firebase数据库实施

编程入门 行业动态 更新时间:2024-10-09 21:21:36
本文介绍了如何解决“清单合并错误"?由于Firebase数据库实施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在编写一个23 API应用程序,并且需要添加Firebase数据库服务.当我添加行

I'm coding an 23 API app, and i need to add Firebase Database services. When i add the line

implementation 'com.google.firebase:firebase-database:18.0.0

在gradle应用中,我尝试同步,但显示失败:

in the gradle app and i try to sync, it failes showing this:

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 <application> element at AndroidManifest.xml:15:5-48:19 to override.

有人可以帮我吗?

这是我的应用gradle文件

This is my app gradle file

apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.QUeM.TreGStore" minSdkVersion 23 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']) //noinspection GradleCompatible implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' // Glide image library implementation 'com.github.bumptech.glide:glide:4.3.1' //dipendenza per firebase implementation 'com.google.firebase:firebase-core:11.8.0' implementation 'com.google.firebase:firebase-database:18.0.0' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:support-annotations:28.0.0' implementation 'android.arch.lifecycle:extensions:1.1.1' 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' implementation 'com.google.android.gms:play-services-vision:11.8.0' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' } //plugin per l'utilizzo di firebase apply plugin: 'com.google.gms.google-services'

推荐答案

如果要使用implementation 'com.google.firebase:firebase-database:18.0.0,则必须执行以下操作:

If you want to use implementation 'com.google.firebase:firebase-database:18.0.0 then you have to do the following:

从文档:

此版本是主要版本更新,其中包含重大更改. 在此版本中,库从Android支持库迁移到Jetpack(AndroidX)库. 除非您在应用中进行以下更改,否则更新的库将无法工作:

This release is a MAJOR version update and includes breaking changes. With this release, libraries are migrated from the Android Support Libraries to the Jetpack (AndroidX) Libraries. The updated libraries will not work unless you make the following changes in your app:

  • 将com.android.tools.build:gradle升级到v3.2.1或更高版本.

  • Upgrade com.android.tools.build:gradle to v3.2.1 or later.

将compileSdkVersion升级到28或更高版本.

Upgrade compileSdkVersion to 28 or later.

要将其他依赖项迁移到androidx程序包,可以执行以下操作:

To migrate the other dependencies to androidx package, you can do the following:

在Android Studio 3.2及更高版本中,您可以通过从菜单栏中选择重构>迁移到AndroidX ,来快速迁移现有项目以使用AndroidX.

With Android Studio 3.2 and higher, you can quickly migrate an existing project to use AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.

检查此以获取更多信息:

Check this for more info:

developer.android/jetpack/androidx/migrate#migrate

更多推荐

如何解决“清单合并错误"?由于Firebase数据库实施

本文发布于:2023-11-25 09:24:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629207.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何解决   清单   错误   数据库   Firebase

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!