2019独角兽企业重金招聘Python工程师标准>>>
日常习惯用ButterKnife进行控件绑定
GIitHub
心血来潮...
升级使用最新版本 10.1.0编译不能通过
dependencies {
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.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:5:5-33:19 to override.
日志分析:
关键字 Manifest merger failed 、androidx 大概得出是重复引用了
给出的修改意见 Suggestion: add 'tools:replace="android:appComponentFactory"' 修改后引入新的问题
调查结果
ButterKnife最新版本已经对应AndroidX升级
如果当前你项目没有支持AndroidX将导致依赖冲突
至于详细原因见:AndroidX兼容
不管你喜不喜欢 androidX 它都来了
androidx 出现规范代码,但是产生一个过渡期,什么过渡期? support到androidx过渡,对于我们来说又是一顿查找替换。为什么查找替换,因为原来api类名不变的情况下,androidx报名全部发生变化。这导致同一个项目中androidx 和 support会产生冲突
AndroidX了解一下
解决方案
降级:8.8.10