Android Annotation official website: https://github.com/excilys/androidannotations
The Android annotation official website has mentioned in the Gradle How to configure:
Https://github.com/excilys/androidannotations/wiki/Building-Project-Gradle
I also refer to the configuration above. My configuration is as follows, there are two places to configure:
1> Project Build.gradle:
sub-projects/modules.buildscript { repositories { jcenter() } dependencies { ‘com.android.tools.build:gradle:1.2.2‘ not place your application dependencies here; they belong // in the individual module build.gradle files <font color="white"> ‘com.neenbedankt.gradle.plugins:android-apt:1.4+‘ <font> }}allprojects { repositories { jcenter() }}
2> module's Build.gradle:
Apply plugin:' Com.android.application 'Apply plugin:' Android-apt 'def aaversion =' 3.2+ 'Android {Compilesdkversion ABuildtoolsversion"22.0.1"Defaultconfig {ApplicationID"Com.sondon.mayi.hii"Minsdkversion theTargetsdkversion AVersioncode1Versionname"1.0"} buildtypes {release {minifyenabledfalseProguardfiles Getdefaultproguardfile (' Proguard-android.txt '),' Proguard-rules.pro '}}}dependencies {Compile Filetree (dir:' Libs ', include: [' *.jar ']) apt"org.androidannotations:androidannotations:$AAVersion"Compile"Org.androidannotations:androidannotations-api:$AAVersion"Compile' com.android.support:appcompat-v7:22.1.1 'Compile' com.android.support:support-v4:22.1.1 '}apt {arguments {androidmanifestfile variant.outputs[0].processresources.manifestfile//ifYou had multiple outputs (when using splits), and you could want to the other index than0You canSetOptional annotation processing options here, like these commented options://LogLevel' INFO 'LogFile'/var/log/aa.log '}}
Recompile, then!
Android Studio Configuration Android annotation