Хороший способ, чтобы добавить аннотацию через Gradle. Затем вы можете импортировать и редактировать его.
Здесь у вас есть link для официальной документации AndroidAnnotation
И вот моя рабочая Gradle конфигурация: build.gradle (Projec: ProjectName)
buildscript {
repositories {
mavenCentral()
}
dependencies {
// replace with the current version of the Android plugin
classpath 'com.android.tools.build:gradle:2.1.2'
// replace with the current version of the android-apt plugin
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
repositories {
mavenCentral()
mavenLocal()
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (модуль: приложение)
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
def AAVersion = '4.0.0'
android {
compileSdkVersion 23
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "example.project"
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'
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
Предполагаю, вы говорите об AndroidAnnotations. Просто взгляните на их документацию. У них есть довольно подробное руководство для Android Studio и Gradle: https://github.com/excilys/androidannotations/wiki/Configuration – peshkira
Спасибо, действительно помог мне! :) – sshifty