匕首和黄油刀

Dagger and Butterknife

我在我的应用程序中使用了 dagger2。但是当我开始项目时,我的活动在构建时得到了扩展支持 AppcompatActivity.Now 我通过 butterknife 收到警告。

API 'variantOutput.getProcessResources()' 已过时并已替换为 'variantOutput.getProcessResourcesProvider()'.

要解决此问题,我必须将 butterknife 版本从 9.0.0-rc1 升级到 10.2.0,当我将 butterknife 版本更改为 10.2.0 时出现错误 build.Because 我没有使用 androidx。错误如下:

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:9:5-70:19 to override.

所以我不知道如何解决这个问题issue.If有人遇到过这样的错误和警告如果你解决了请帮助我

它从字面上说明了您需要做什么。像这样添加 tools:replace="android:appComponentFactory"<application tools:replace="android:appComponentFactory"

将你的项目迁移到AndroidX,butterknife 10.2.0在androidX上。