annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

ButterKnife使用
本文介绍ButterKnife版本8.8.1的配置方法与注意事项,包括annotationProcessor与implementation的使用,以及可能出现的问题与解决办法。

ButterKnife黄油刀里面的 点击事件支持工具apt不支持维护后的替代工具:

annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.jakewharton:butterknife:8.8.1'

注释掉:
//annotationProcessor ‘com.jakewharton:butterknife-compiler:8.8.1’
你会发现直接报空指针了,你明明已经注册过了啊:
在这里插入图片描述在这里插入图片描述请注意:注释掉之后只要你不clean项目,Sync同步下不会报以上错误。卸载app重新打包也没问题。
// annotationProcessor ‘com.jakewharton:butterknife-compiler:8.8.1’
但是clean项目后,各种情况报错。最后还是按官方文档走吧。

dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:2.0.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30' implementation 'com.android.support:design:28.0.0' implementation 'com.github.bumptech.glide:glide:4.9.0' implementation 'com.android.support:multidex:1.0.3' //图片/视频选择、预览、编辑与拍照 implementation 'com.contrarywind:Android-PickerView:3.2.7' implementation 'com.github.guoxiaoxing:phoenix:1.0.15' implementation 'cn.yc:YCVideoPlayerLib:2.6.4' implementation 'com.jakewharton:butterknife:8.8.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' //选填 - 图片压缩,开启功能:Phoenix.with().enableCompress(true),获取结果:MediaEntity.getCompressPath() implementation 'com.github.guoxiaoxing:phoenix-compress-picture:1.0.15' implementation 'de.hdodenhof:circleimageview:2.1.0' implementation 'com.zhy:okhttputils:2.6.2' api 'com.just.agentweb:agentweb:4.1.2' // (必选) api 'com.just.agentweb:filechooser:4.1.2' // (可选) api 'com.download.library:Downloader:4.1.2' api 'com.contrarywind:Android-PickerView:3.2.7' api 'com.github.PhilJay:MPAndroidChart:v3.0.0' implementation 'com.imusic.player:video-player:1.0.9' }迁移为新版本
03-31
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值