设置目标并将sdk版本编译为28之后,我仍然看到此错误:
Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:8:5-41:19 to override.
这是app:gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
lintOptions {
abortOnError false
}
defaultConfig {
applicationId "com.tawkon.data.lib.indooroutdoor"
minSdkVersion 14
targetSdkVersion 28
versionCode 3
versionName "1.6.4"
}
buildTypes {
release {
debuggable false
}
debug {
debuggable true
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0-rc01'
implementation 'de.greenrobot:eventbus:2.4.1'
implementation 'com.splunk.mint:mint:4.2.1'
implementation 'joda-time:joda-time:2.3'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation project(':library')
}
我尝试在清单中的应用程序标记中添加tools:replace="android:appComponentFactory"
,但它始终显示错误:
Manifest merger failed with multiple errors, see logs
该如何解决?
答案 0 :(得分:1)
将这些标志放入您的gradle.properties
android.enableJetifier=true
android.useAndroidX=true
答案 1 :(得分:0)
您好,如果您使用的是 androidx ,请检查您的库项目,所有依赖项是否为androidx。 并更改此依赖项
implementation 'com.google.android.material:material:1.0.0'
答案 2 :(得分:0)
答案 3 :(得分:0)
请将此依赖项newlist
更改为implementation 'androidx.appcompat:appcompat:1.0.0'
,希望对您有所帮助。
答案 4 :(得分:0)
请按照以下步骤操作:-
android.useAndroidX = true
android.enableJetifier = true