apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 24
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.android.booklistingapp"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.jakewharton:butterknife:8.4.0'
}发布于 2017-04-30 18:21:25
将这些行添加到Android Studio项目根目录下的build.gradle文件中。
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}发布于 2017-04-30 18:15:34
您必须为android-apt插件添加类路径:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}在依赖项中,您还需要编译器的apt依赖项:
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.jakewharton:butterknife:8.4.0'
// Add this
apt 'com.jakewharton:butterknife-compiler:8.4.0'
}https://stackoverflow.com/questions/43678433
复制相似问题