引用ButterKnife之后。还需要配置两个文件:
1.在project的build.gradle中
dependencies { classpath 'com.android.tools.build:gradle:2.3.3' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }
2.在module的build.gradle中
compile 'com.jakewharton:butterknife:8.8.1' apt 'com.jakewharton:butterknife-compiler:8.8.1'
这时butterknife的环境就配置好了,可以运行测试一下
原文链接:https://www.f2er.com/javaschema/282594.html