How to properly configure IntelliJ IDEA to handle Android annotations?

How to properly configure IntelliJ IDEA for annotation processing?

Using the maven processor:process target works fine, but how can I process without using the maven target in IntelliJ IDEA (using Annotation Processing settings)?

According to IntelliJ's preferences / annotation processors, I have the following setting: " Enable annotation processing " is checked with the option " Obtain processors from project classpath "

I leave the " Annotation Processors " section empty, as it should be found through the class path, which I assume automatically. In the processed module, I select my Android module and " target/generated-sources/apt " as " Generated Sources Directory Name ".

In my project structure, I have module dependencies " Maven: com.googlecode.androidannotations:androidannotations:2.6 " and " Maven: com.googlecode.androidannotations:androidannotations:api:2.6 ", so I have a processor in my classpath.

But building a project does not process annotations, and instead I get the warning ' Annotation processing without compilation requested but no processors were found. ''

And if I try to manually process the annotation processor " com.googlecode.androidannotations.AndroidAnnotationProcessor " and selecting " /path/to/libs/androidannotations-2.6-api.jar " as the path to the processor, I get the error message "Annotation processor" com.googlecode.androidannotations.AndroidAnnotationProcessor "not found" when trying to create a project.

This is my configuration in the screenshots: http://imageshack.us/photo/my-images/841/intellijaa.png/

enter image description here

+4
source share
1 answer

I still did not work using the "Obtain processors from project classpath" , but now it works when you select the path / jar for the processor manually.

I really tried this before, but my mistake was that I chose AA-api.jar instead of the usual AA.jar.

Thanks to Dave for giving a hint through a screenshot in google AA groups:

https://groups.google.com/forum/?fromgroups#!topic/androidannotations/PnAWuSQHkhg

+5
source

All Articles