Android Studio: Use AndroidAnnotations

Basic Coder picture Basic Coder · May 16, 2013 · Viewed 18.9k times · Source

So I wanted to try the new Android Studio and imported my eclipse projects (I generated a gradle build file). Worked pretty good.

The only library which does not seem to work is AndroidAnnotations. I selected the androidannotations-2.7.jar file under File > Settings > Compiler > Annotation Processing.

As production source directory i selected "gen". But the generated file like MainActivity_ are not generated. What did I wrong?

Answer

Grant Caesar Peters picture Grant Caesar Peters · May 18, 2013

I had the same issues, followed the instructions for configuring aa with intelliJ, now it works like a charm does.

AA intelliJ config page will point you to this post...

http://www.ashokgelal.com/2012/12/setting-up-intellij-idea-12-with-maven-actionbarsherlock-roboelectric-androidannotations/

...the above post walks you through setting up various libs in intelliJ, scroll towards the bottom for AA.

The main thing I had to do that I did not have to do in eclipse was go to Preferences > Compiler > Annotation Processors and set my Processor Path to something like...

[PATH TO AA JARS]/androidannotations-2.7.jar:[PATH TO AA JARS]/androidannotations-api-2.7.jar:[PATH TO AA JARS]/codemodel-2.4.1.jar