Execution failed for task ':app:processDebugManifest'.

  使用新版的Android Studio导入以前的项目,会出现Execution failed for task ‘:app:processDebugManifest’. 的错误

在这里插入图片描述

* What went wrong:
Execution failed for task ‘:app:processDebugManifest’.
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-alpha1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add ‘tools:replace=“android:appComponentFactory”’ to element at AndroidManifest.xml:11:5-50:19 to override.

  根据AS提供的提示进行修改,在AndroidManifest.xml文件中添加如下字段——

<application

 android:appComponentFactory=""
 tools:replace="android:appComponentFactory">

  如果提示tools字段没有绑定,鼠标悬停在tools上会出现一个提示,然后直接点击Alt+Enter 添加即可。然后Rebuild项目,问题解决。

发布了222 篇原创文章 · 获赞 558 · 访问量 38万+

猜你喜欢

转载自blog.csdn.net/CV_Jason/article/details/96838809