当我在gradle中添加导航声明时。在午餐应用程序时显示以下错误:
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-alpha05] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-21:19 to override.
我由谷歌编写的gradle代码-------------->:
def nav_version = "2.1.0-alpha01"
implementation "androidx.navigation:navigation-fragment:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version"
在 gradle 中声明这一点会崩溃我的应用程序
tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString"
在 Android 清单中的应用程序标记中添加上述行