android - 如何删除清单合并错误
问题描述
我在没有使用 androidx 的项目中添加了 MaterialAlertDialog。这会在下一次构建期间导致错误。所以我从应用程序级别的构建 gradle 中删除了“实现”语句。但是当我尝试构建我的项目时,我仍然有明显的合并错误。
这是我在构建时遇到的错误
清单合并失败:来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 的属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) 也存在于[androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory)。建议:将 'tools:replace="android:appComponentFactory"' 添加到 AndroidManifest.xml:19:5-152:19 的元素以覆盖。
到目前为止,我已经尝试了以下解决方案,关闭并重新加载我的项目。清理并重建 .delete 项目中的 .gradle 和 .idea 文件夹,然后重新构建
这些是我项目中的依赖项
dependencies
{
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "com.android.support:appcompat-v7:${android_support_version}"
implementation "com.android.support:design:${android_support_version}"
implementation 'com.github.lzyzsd:circleprogress:1.1.0@aar'
implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1@aar'
implementation 'commons-net:commons-net:3.3'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
implementation "de.hdodenhof:circleimageview:${circle_imageview}"
implementation "com.github.bumptech.glide:glide:${glide_version}"
implementation "com.android.support:recyclerview-v7:${android_support_version}"
implementation "com.android.support:cardview-v7:${android_support_version}"
implementation "com.squareup.retrofit2:retrofit:${retrofit_service_version}"
implementation "com.squareup.retrofit2:converter-gson:${retrofit_gson_convertor}"
implementation "com.clough.android.androiddbviewer:androiddbviewer:${dbviewer_version}"
implementation "com.android.support:multidex:${multidex_version}"
implementation "com.github.crosswall:Android-Coverflow:${viewPager_version}"
implementation "com.squareup.okhttp3:logging-interceptor:3.4.0"
implementation project(':sdkui')
implementation 'com.github.ronaldsmartin:Material-ViewPagerIndicator:1.0.4'
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.android.gms:play-services-identity:16.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-auth-api-phone:16.0.0'
implementation 'com.google.firebase:firebase-config:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
}
apply plugin: 'com.google.gms.google-services'
解决方案
我回答这个只是为了指定解决我的问题所采取的步骤。
- 我删除了 MaterialDesign 的 gradle 依赖项。
- 通过执行 File-> Invalidate Cache & restart 解决了现金问题
由于 Firebase 在重新启动之前已更改为 20 版,因此问题仍然存在。
将 Firebase 版本降低到 17.3.4,这解决了所有问题。
推荐阅读
- python - 为什么 gcloud ml-engine submit 命令给出“requested cpu s超过 quota”?
- c# - 在 C# 中将泛型显式转换为另一种类型
- html - 如何垂直对齐动态长度的文本,同时让它环绕浮动图像?
- python - 为什么 base64.b64encode 返回值 b'somestring' 而不是简单的 'somestring'?
- python - 如何在 Outlook (2010) 全局地址列表中搜索多个名称?
- angular - 角度字符串插值在 JSON 对象值上打印空字符串
- python - 需要有关 python 描述符功能的帮助
- android - Dart 项目可以拥有的最大方法数是多少?
- python - 在反向查询(related_name)中检索 Django QuerySet 匹配字段
- powershell - 从 PowerShell 使用 WinSCP .NET 程序集时“找不到类型 [WinSCP.RemotePath]”