Butter Knife地址:http://jakewharton.github.io/butterknife
首先我们看Butter Knife官网的教程:
- buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
- }
- }
-
- apply plugin: 'com.neenbedankt.android-apt'
-
- dependencies {
- compile 'com.jakewharton:butterknife:8.0.1'
- apt 'com.jakewharton:butterknife-compiler:8.0.1'
- }
按照上述配置,你可能会出现编译上的问题,如找不到com.neenbedankt.Android-apt等问题。
经过测试,总算搞清楚了问题。
首先看下面的工程目录:
httptest/build.gradle配置文件中添加:
- buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:2.1.0'
- classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
- }
- }
也就是我们修改gradle版本的那个build文件。
app/build.gradle配置文件中如下:
- apply plugin: 'com.android.application'
- apply plugin: 'com.neenbedankt.android-apt'
-
- android {
- compileSdkVersion 23
- buildToolsVersion "23.0.3"
-
- defaultConfig {
- applicationId "com.baidu.retrofitdemo"
- minSdkVersion 16
- targetSdkVersion 23
- versionCode 1
- versionName "1.0"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-
-
- }
-
- dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- testCompile 'junit:junit:4.12'
- compile 'com.android.support:design:23.3.0'
- compile 'com.android.support:appcompat-v7:23.3.0'
- compile 'com.squareup.okhttp3:okhttp:3.2.0'
- compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
- compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
- compile 'com.jakewharton:butterknife:8.0.1'
- apt 'com.jakewharton:butterknife-compiler:8.0.1'
- }
如此,clean下就可以使用了。
相关推荐
ButterKnife
主要介绍了android studio 安装完成ButterKnife插件却无法使用问题,本文通过图文并茂的形式给大家分享解决方法,对大家有非常好的帮助,需要的朋友可以参考下
butterknife:7.1.0+ButterKnife
在androidStudio 上用的本地插件 ,解决因为代理的问题不能搜索到这些插件的小伙伴们Butterknife GsonFormat
butterknife butterknife-annotations butterknife-compiler butterknife-gradle-plugin New: Support for Jack compiler in application projects. Fix: Generate ~20% less code and ~40% less methods. Fix: ...
butterknife8.0.1 demo,
ButterKnife 原理简单实现
butterknife3.0.0 ,butterknife5.0.0,butterknife5.1.1 , butterknife6.0.0,butterknife7.0.0 ,butterknife7.0.1
butterknife butterknife-annotations butterknife-compiler @Bind becomes @BindView and @BindViews (one view and multiple views, respectively). Calls to bind now return an Unbinder instance which can ...
butterknife android-studio butterknife android-studio butterknife android-studio butterknife android-studio butterknife android-studio butterknife android-studio butterknife android-studio butterknife...
butterknife-butterknife-parent-7.0.1.zip
最新版本的butterknife-7.0.1jar包
ButterKnife集成
butterknife的jar包
butterknife butterknife-annotations butterknife-compiler New: Change the structure of generated view binders to optimize for performance and generated code. This should result in faster binding (not ...
butterknife butterknife-annotations butterknife-compiler butterknife-gradle-plugin Fix: Do not emit android.R imports in generated code. Fix: Ensure the processor does not crash when scanning for R ...
ButterKnife的简单使用的源码,绑定控件点击事件,这是一个ListView的使用案例
butterknife-7.0.1
butterknife-8.5.1的lib androidstudio需要的库,才能正常使用插件