First, create a new Android studio project
Second, open the Build.gradle
Add the following sentence: Classpath ' com.neenbedankt.gradle.plugins:android-apt:1.4 ' (some say: Classpath ' com.neenbedankt.gradle.plugins:android-apt:1.3 ' possible version is different, my use of 1.3 will be problematic)
Iii. opening the Build.gradle in the project
Add the contents of the red box below
1.
Apply plugin: ' Android-apt '
def aaversion = ' 3.0.1 '
2.
Apt "org.androidannotations:androidannotations: $AAVersion"
Compile "Org.androidannotations:androidannotations-api: $AAVersion"
3.
Apt {
arguments {
Androidmanifestfile Variant.outputs[0].processresources.manifestfile
Androidmanifestfile Variant.processResources.manifestFile
Resourcepackagename ' Com.example.zhangchangan.demo '
}
}
The above three steps have been configured, after completion, click the button below, compile, if there is no problem, you can use @eactivity (r.layout.xxx), do not forget to add "_" after the Java class in the manifest file
Android Studio Configuration Androidannotation