主要配置project下的build.gradle
新版的Android Studio 不像Eclipse, 它没有Annotation Processing。
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
buildscript {
repositories {
mavenCentral()
}
dependencies {
// replace with the current version of the Android plugin
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2+'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.matrix.comic.annotationtest" //your project name
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName "com.matrix.comic.annotationtest" //your project name
}
}
dependencies {
apt "org.androidannotations:androidannotations:3.0+" // add these
compile "org.androidannotations:androidannotations-api:3.0+" // two lines
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
}
对比以上和自己的文件进行添加和修改。