我有一个Android应用程序,我想添加此库:
implementation 'com.google.android.ump:user-messaging-platform:1.0.0'
添加时出现此错误:
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:23:5-209:19 to override.
当我添加以下行时:
tools:replace="android:appComponentFactory"
我收到此错误:
Error:
tools:replace specified at line:23 for attribute android:appComponentFactory, but no new value specified
任何主意是什么问题?如何添加此库?也许我可以添加该库的先前版本?
根据我的阅读,它与AndroidX
相关,但是我不想将项目更新为AndroidX,因为它是一个旧项目,这会给我带来很多问题。
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.support:design:28.0.0'
compile 'com.android.support:recyclerview-v7:28.0.0'
compile 'com.android.support:appcompat-v7:28.0.0'
compile 'com.android.support:cardview-v7:28.0.0'
implementation "com.android.support:support-compat:28.0.0"
compile 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.ump:user-messaging-platform:1.0.0'
答案 0 :(得分:1)
只需启用Jetifier即可转换其他依赖项名称空间:
android.useAndroidX=true
android.enableJetifier=true
答案 1 :(得分:0)
错误:在属性的第23行指定了tools:replaces android:appComponentFactory,但未指定新值
您应该同时添加两个
tools:replace="android:appComponentFactory"
android:appComponentFactory="android.support.v4.app.CoreComponentFactory"
确保,您在下面的 gradle.properties
文件中添加了
android.useAndroidX=true
android.enableJetifier=true
仅供参考
implementation 'com.google.android.ump:user-messaging-platform:1.0.0'
我们建议您更新项目以使用支持库的最终版本: 版本28.0.0。这是因为版本为1.0.0的AndroidX工件 与支持库28.0.0工件等效。