首先project下的build.gradle配置(就加了一行butterknife)
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0' // 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 }然后app下的build.gradle配置
apply plugin: 'com.android.application' android { compileSdkVersion 24 buildToolsVersion "24.0.2" defaultConfig { applicationId "com.zdfy.propertyanimation" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" /*****jackOptions start********/ jackOptions { enabled true } /*****jackOptions end********/ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } /*************lambda~start*************/ compileOptions { sourceCompatibility 1.8 targetCompatibility 1.8 } /*************lambda~end*************/ buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } 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' testCompile 'junit:junit:4.12' /*****************butterknife:8.4.0 start*****************/ compile 'com.jakewharton:butterknife:8.4.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' /*****************butterknife:8.4.0 end******************/ }