今天小編就爲大家分享一篇關於Android添加ButterKnife時報錯Error:(2, 0) Cannot add extension with name 'android'的解決辦法,小編覺得內容挺不錯的,現在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧
在添加ButterKnife
的時候,根據它的Readme
配置以後報錯:
Error:(2, 0) Cannot add extension with name 'android', as there is an extension already registered with that name.
解決方法如下:
默認我們在自己的module
下添加後是這樣的:
apply plugin: 'com.android.application'
apply plugin: 'com.android.library'
apply plugin: 'com.jakewharton.butterknife'
此時,我們只需要刪掉
apply plugin: 'com.android.library'
這一行就行了,因爲它跟com.android.application
衝突了。
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作具有一定的參考學習價值,謝謝大家對神馬文庫的支持。如果你想了解更多相關內容請查看下面相關鏈接