您的位置:首页 > Web前端

使用butterknife bind之后依然运行报空指针问题解决方法

2017-03-03 15:52 411 查看
butterknife8.0之后才有apt方式,配置方法如下:

在项目的gradle文件的dependencies中增加

dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}


在应用的gradle文件中添加:

apply plugin: 'com.neenbedankt.android-apt'

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile project(':core')
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  gradle 指针 apt butterknif
相关文章推荐