Android添加ButterKnife时报错Error:(2, 0) Cannot add extension with name 'android'的解决办法

发布时间:2020-09-24 07:45:33 作者:franksight
来源:脚本之家 阅读:155

在添加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冲突了。

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对亿速云的支持。如果你想了解更多相关内容请查看下面相关链接

推荐阅读:
  1. Android 碎片(Fragment)讲解
  2. Android绘制发光效果的方法

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

android butterknife 报错

上一篇:Pycharm+Python工程,引用子模块的实现

下一篇:go实现redigo的简单操作

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》