不知为什么这次创建了一个moudle导入支持库之后出现了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
仔细打开后出现了Execute taskAction
详细的错误
java.lang.RuntimeException: 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 element at AndroidManifest.xml:5:5-19:19 to override.
at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:540)
at com.android.build.gradle.tasks.MergeManifests.doFullTaskAction(MergeManifests.java:173)
等等
重点在这里,解决办法就是在 gradle.properties文件里面加上
android.useAndroidX=true
android.enableJetifier=true
然后在同步一下就可以了
还有就是可能导入的库版本过高,这个时候可以试一试降低一下导入的版本,在这里我就是降低的版本解决的问题
欢迎给我留言你遇到的问题