android - Android:清单合并失败
问题描述
更新后收到此消息,我该如何解决此问题?我已经尝试过建议消息将 'tools:replace="android:appComponentFactory" 添加到应用程序标签,但仍然无法正常工作。
这是构建失败的错误:
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:18:5-103:19 to override.
这是我的 gradle 应用程序:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.martienp45.e_catalogbatik"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.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.google.android.gms:play-services-maps:16.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'
implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
implementation 'com.google.code.gson:gson:2.8.2'
}
解决方案
请打开您的 AndroidManifest.xml,然后您将在下方看到一个名为“Merged Manifest”的选项卡。这将告诉您在 AndroidManifest 文件中的哪一行出现错误。
推荐阅读
- apache-kafka - Apache Kafka 中的用户活动日志和 GDPR 删除请求
- javascript - 仅将 z-index 应用于子组件不起作用
- python - GCS 获取 blob 文件名
- authentication - 刷新 JWT 令牌后如何重试 API 调用?
- sql-server - Azure SQL 数据同步:表名中的无效字符
- sql - 是否可以强制关系是一对一而不是一对多?如果没有,那又如何?
- python - 将字符串转换为日期时间对象 -- '2020-11-16' 转换为日期
- php - 使用php执行preg_match_all时尝试存储接口
- javascript - 使用 onBlur 触发器时如何清除验证模糊错误?
- pre-commit.com - 如何在 pre-commit.com 中使用新的 coursier 语言?