突然有一种把所有流行框架都用一遍的想法,想到就做。
导入了依赖之后总是提示控件空指针,最后发现8版本之后跟之前的配置有一些差别,我已出坑,希望大家也能尽快出坑。
先贴github原文
Configure your project-level build.gradle
to include the 'android-apt' plugin:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
Then, apply the 'android-apt' plugin in your module-level build.gradle
and add the Butter Knife dependencies:
apply plugin: 'android-apt'
android {
...
}
dependencies {
compile 'com.jakewharton:butterknife:8.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
}
再贴我自己的配置
在build.gradle(Project:xxx)中
dependencies { classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' }
在build.gradle(Module:app)中
在第二行加入
apply plugin: 'com.neenbedankt.android-apt'
dependencies { compile 'com.jakewharton:butterknife:8.2.0' apt 'com.jakewharton:butterknife-compiler:8.2.0' }
我在使用klog的时候遇到另一个坑,就是初始化的tag无效,目前还没出坑,有用过的大神,请指点一二
如果有想一起交流的小伙伴,可以加QQ群:263027541或者加我QQ:454214711
希望能尽绵薄之力帮助到各位