依赖butterknife库报错
来源:3-6 客户端封装Activity和Fragment-2

慕田峪8142466
2019-09-26
在common的build.gradle中加入两行代码
implementation "com.jakewharton:butterknife:10.2.0"
annotationProcessor “com.jakewharton:butterknife-compiler:10.2.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 element at AndroidManifest.xml:6:5-21:19 to override.
1回答
-
Qiujuer
2019-09-27
啊,这个库不建议使用10以上的版本,其实9的版本就行了。
com.jakewharton:butterknife。看我的git最新代码哈,里边有稳定的9的版本,使用起来没有问题的。如果使用10的版本,他率先切换到Androidx库的依赖了,恰巧项目有大量使用support库的地方。所以会引起冲突。
后面会考虑将项目整体迁移到androidx库下,到时候可以多多关注最新的git源码更新哈。
00
相似问题