我是靠谱客的博主 完美荷花,这篇文章主要介绍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
冲突了。
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对靠谱客的支持。如果你想了解更多相关内容请查看下面相关链接
最后
以上就是完美荷花最近收集整理的关于Android添加ButterKnife时报错Error:(2, 0) Cannot add extension with name 'android'的解决办法的全部内容,更多相关Android添加ButterKnife时报错Error:(2,内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复