Android studio 添加com.jakewharton:butterknife:8.5.1注解框架

本文详细介绍了如何在Android项目中集成ButterKnife库,包括在项目Gradle文件中添加依赖及插件,以及同步项目等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

第一步:在项目的gradle中添加

dependencies {
    classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'
}
 第二步:在App的gradle中添加

apply plugin: 'com.jakewharton.butterknife'

第三步:在App的gradle dependencies中添加

compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

最后Sync Now一下就行,当然也可以直接在Project Structure中添加




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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值