dependencies {
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
这些是 build.gradle 中的依赖项
清单合并失败:来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 的属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) 也存在于[androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory)。建议:将 'tools:replace="android:appComponentFactory"' 添加到 AndroidManifest.xml:7:5-21:19 的元素以覆盖。
我希望在我的项目中添加一个库,它被称为 ButterKnife 库,在添加这个库之前项目很好,但是当我添加了这个库时。发生清单合并失败错误。
我试过什么?我将这些行添加到我的 AndroidManifest.xml 中:
tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString"
但这产生了另一组错误
原因:com.android.tools.r8.utils.AbortException:错误:仅支持从 Android N 开始的静态接口方法(--min-api 24):void butterknife.Unbinder.lambda$static$0()
我尝试删除黄油刀库,然后它构建得很好。
我还尝试仅添加其中一行:
tools:replace="android:appComponentFactory"
这什么也没做,又产生了另一个错误:
清单合并失败并出现多个错误,请参阅日志
我尝试了 Refractor->migrate to androidx,这在 Java 文件中产生了一个新问题,现在说它“无法解析符号 R”
那么我该怎么办,我正在网上学习一些应用程序开发课程。教授这门课的人似乎没有这些错误。