天天看點

AndroidStudio使用butterknife的問題

一、按照butterknife的官網(ButterKnife)說明配置後,執行sync now,出現了編譯錯誤:

Manifest merger failed : Attribute [email protected] 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:36:5-364:19 to override.
           

網上搜尋,依照這篇部落格(部落格)的方式一解決了編譯的錯誤。

二、但是,緊接着就出現了下面的錯誤:

Static interface methods are only supported starting with Android N (--min-api 24): void butterknife
           

是根據這篇部落格(部落格)的方法解決的。

項目可正常運作了。