美文网首页
Android studio 报错'tools:replace=

Android studio 报错'tools:replace=

作者: 全球顶尖伪极客 | 来源:发表于2019-04-08 16:38 被阅读0次

Android studio3.1.3(较老版本)依赖butterknife报错:

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:6:5-30:19 to override.

根据提示加入:

tools:replace="android:appComponentFactory"

加入后仍然报错:

Manifest merger failed with multiple errors, see logs

经查阅后完成添加两行即可:

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

完整代码AndroidManifest.xml中的application标签:


    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:replace="android:appComponentFactory"
        android:appComponentFactory=""
        >

相关文章

网友评论

      本文标题:Android studio 报错'tools:replace=

      本文链接:https://www.haomeiwen.com/subject/wbcpiqtx.html