Referring to the demo on GitHub, after creating a new project, there will be a local build.gradle file located under the App folder and a global build.gradle file located under the root directory project, and we are going to modify the local Gradle file:
1 Buildscript {2 Repositories {3 mavencentral ()4 }5 Dependencies {6 //Replace with the current version of the Android plugin7Classpath ' com.android.tools.build:gradle:1.0.0 '8 //The latest version of the ANDROID-APT plugin9Classpath ' com.neenbedankt.gradle.plugins:android-apt:1.4 'Ten } One } A - Repositories { - mavencentral () the mavenlocal () - } - -Apply plugin: ' Com.android.application ' +Apply plugin: ' Android-apt ' -def aaversion = ' 3.3-snapshot '//your desired version, for example the latest stable:3.2 + A Dependencies { atApt "org.androidannotations:androidannotations: $AAVersion" -Compile "Org.androidannotations:androidannotations-api: $AAVersion" - } - - Apt { - arguments { inAndroidmanifestfile variant.outputs[0].processresources.manifestfile - //If you had multiple outputs (when using splits), you could want to has the other index than 0 to +Resourcepackagename ' Org.androidannotations.gradle ' - the //If you ' re using Android NBS flavors should use the following line instead of hard-coded PackageName * //resourcepackagename Android.defaultConfig.packageName $ Panax Notoginseng //You can set optional annotation processing options here, like these commented options: - //logLevel ' INFO ' the //logFile '/var/log/aa.log ' + } A } the + Android { -Compilesdkversion 19 $Buildtoolsversion "21.1.1" $ - Defaultconfig { -Minsdkversion 9 theTargetsdkversion 19 - }Wuyi}
Finally, add _ (underline) after the name of the activity in the Androidmanifest.xml.
Then compile the project to complete! If the error, please compile several times. Compile button:
My smooth compilation passed. Reference Blog: http://blog.csdn.net/ljphhj/article/details/37601173
Android Studio Frame Build: Add note frame annotations