Android Studio butterknife配置使用

来源:互联网 发布:php 私有方法 编辑:程序博客网 时间:2024/06/06 13:20

Project的build.gradle文件中增加classpath

buildscript {    repositories {        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:2.2.1'        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}allprojects {    repositories {        jcenter()    }}task clean(type: Delete) {    delete rootProject.buildDir}

Module bulid.gradle插入

apply plugin: 'com.neenbedankt.android-apt'dependencies {    compile fileTree(dir: 'libs', include: ['*.jar'])    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'    compile 'com.android.support:design:24.2.1'    testCompile 'junit:junit:4.12'    compile 'com.jakewharton:butterknife:8.0.1'    apt 'com.jakewharton:butterknife-compiler:8.0.1'}
0 0
原创粉丝点击