我不明白这个“ margin manifest”错误

时间:2019-02-19 11:41:37

标签: android xml android-manifest

我正在使用Firebase数据库开发聊天应用程序。在处理它时,每当我尝试运行该应用程序时,我都会收到此错误。

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.1.0-alpha03] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-30:19 to override.

这是我的清单代码

Android清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.theroos.chatapp">

    <uses-permission android:name="android.permission.INTERNET" />

    <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"
    android:tools="http://schemas.android.com/tools">

    <activity android:name=".HomeActivity" />
    <activity android:name=".VerifyActivity" />
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <service android:name=".MyFirebaseMessagingservice">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>
    </application>

</manifest>

我不明白为什么会收到此错误及其解决方法。

1 个答案:

答案 0 :(得分:0)

-尝试将这两行放在清单的application标签中:

    tools:replace="android:appComponentFactory"
    android:appComponentFactory="androidx"
相关问题