android - 清单合并失败 android.support.v4.app.CoreComponentFactory
问题描述
给出的错误:
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).
Gradle 依赖项
dependencies {
implementation project(':react-native-image-resizer')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-device-info')
implementation project(':react-native-camera')
implementation project(':react-native-agora')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.getkeepsafe.relinker:relinker:1.3.0'
implementation 'com.android.volley:volley:1.1.0'
implementation files('src/main/jniLibs/HCNetSDK.jar')
implementation files('src/main/jniLibs/PlayerSDK.jar')
implementation 'com.ncorti:slidetoact:0.5.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.pusher:push-notifications-android:1.0.2'
}
编辑:这张GitHub 票帮助我解决了它,似乎是一个 androidx 和 react-native 问题。在这里获得 gms 和 firebase 版本
解决方案
您需要从 andorid.support 和 android.arch 依赖项迁移到 AndroidX。您的项目有冲突,因为错误消息可能是因为反应原生依赖,
TL;DR 摆脱所有依赖项andorid.support
并android.arch
改用 androidX
例如改变
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
进入
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
,
第二个示例更改
implementation 'com.android.support:animated-vector-drawable:28.0.0'
进入
implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0'
并对所有支持依赖项执行类似操作
推荐阅读
- .net - 如何从 ServiceStack API 返回 XmlDocument 作为响应
- unit-testing - 如何使用相对路径在jsdom中加载html文件?
- aurelia - 电子邮件验证通过,无需域扩展
- java - 检测 | 以非零退出值 255 结束
- java - 在 A4 纸上生成 40 个 QR 码的 QR 码表,在不同的系统上产生不同的对齐方式
- angular - Angular 双向数据绑定 - 更改值
- distributed-computing - 在 2PC 中,如果提交失败会发生什么?
- c# - 如何更改插入符号格式
- excel - 使用 VBA 到 AutoCAD 代码的运行时错误 424
- angular - `ngOnChanges` 需要澄清才能理解