清单合并失败。该怎么办?

用户11815221:

尝试在模拟器上运行应用程序,但出现错误,并显示:

清单合并失败:[com.android.support:support-compat:28.0.0]的属性application @ appComponentFactory value =(android.support.v4.app.CoreComponentFactory)来自AndroidManifest.xml:22:18-91 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value =(androidx.core.app.CoreComponentFactory)。建议:在AndroidManifest.xml:6:5-24:19的元素上添加'tools:replace =“ android:appComponentFactory”'以进行覆盖。

我已经看过许多相同的问题,却找不到我的问题的答案。

我的AndroidManifest.xml

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

    <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="allowBackup, label">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

我从合并清单中获得了以下错误:

Merging Errors: 
Error: Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from AndroidManifest.xml:22:18-86 is also present at AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:6:5-24:19 to override. app main manifest (this file), line 21 

该怎么办?(发布更新为新问题)

拉胡尔·欣多查(Rahul Hindocha):

您可以尝试将项目迁移到AndroidX。要进行迁移,请重构>迁移到AndroidX

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章