在用butterknife 的时候遇到了个问题
Error:(27, 0) Gradle DSL method not found: 'apt()'
Possible causes:<ul><li>The project 'TransactionTest' may be using a version of Gradle that does not contain themethod.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>
1.在setting中的pluging中下载butterknife 插件 (是用来做快捷键的)
2.在工程的build.gradle <切记是在工程project里>添加
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
这个很重要!!!!
3.在项目里的build.gradle中<是mudule>中添加引用
compile 'com.jakewharton:butterknife:8.4.0' apt 'com.jakewharton:butterknife-compiler:8.4.0'
和顶部添加
apply plugin: 'android-apt'
最上面那个问题就是顶部没加这一条 做完这三部就ok了!!!