-
Notifications
You must be signed in to change notification settings - Fork 2.3k
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy after moving to Anndroid Anotations v.2.7 #379
Comments
Hi @zasadnyy, thank you for reporting this. As far as I can see, AbstractProcessor.getSupportedSourceVersion() tries to read the From the stacktrace, we can deduce that the AnnotationParser is trying to read all the annotations on the processor class. And that one of these annotations has a class array parameter that contains classes that cannot be loaded. The only annotation that has a class array in From that we can deduce that the annotations supported by androidannotations are not present, which means they are not in the classpath of the eclipse compiler. As you probably noted, we extracted the API jar as a separate Maven artifact, leading to a new maven configuration: <dependencies>
<!-- [...] -->
<dependency>
<groupId>com.googlecode.androidannotations</groupId>
<artifactId>androidannotations</artifactId>
<version>2.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.androidannotations</groupId>
<artifactId>androidannotations-api</artifactId>
<version>2.7</version>
</dependency>
</dependencies> Since you are telling me that is works fine with Maven, I assume you configured this right. Previously, the androidannotations dependency contained the annotations. It doesn't contain them any more, they are now in the androidannotations-api jar. This is fine for Maven, because dependencies available in scope compile are also available to Javac. However, Eclipse differentiate those dependencies with the annotation processing jars. So, I assume that you're using the "manual way" to configure the eclipse annotation processing: adding jars to Java Compiler > Annotation Processing > Factory Path. And it currently only contains To fix the problem, you should add the two AndroidAnnotations dependencies: codemodel and androidannotations-api Here is how we should update the doc:
Could you please confirm if this works or not? If yes we'll update the doc and add a warning. Thanks a lot!
|
Thanks man, for so quick answer! Rgds, Vitaliy. |
I see that you've already updated the documentation on don't forget to also update the part where you put directly the content of the .factorypath file. <factorypath>
<factorypathentry kind="PLUGIN" id="org.eclipse.jst.ws.annotations.core" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/googlecode/androidannotations/androidannotations/2.7/androidannotations-2.7.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/googlecode/androidannotations/androidannotations-api/2.7/androidannotations-api-2.7.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/codemodel/codemodel/2.4.1/codemodel-2.4.1.jar" enabled="true" runInBatchMode="false"/>
</factorypath> Thanks again for the quick update Arnaud |
Maybe it'll be useful to add note that this configuration should be used starting from v.2.7 ? Rgds, Vitaliy. |
You're right. Reopening until we update the doc. |
Hi, I'm getting the same problem with IntelliJ. Using the old 2.7 snapshot was flawless, but with the final version there's no way that this works |
@estornino Could you check #395 ? |
Hi, thanks to Albin from jayway I finally make it work. You can check the process here in the comments http://www.jayway.com/2012/08/31/making-androidannotations-work-with-intellij-idea/ is the same method that the one explained by @satyanarayanag at #395 Using semicolons ';' in the processor path it allows you to include more than one path. |
I'm closing this issue as it seems everyone was able to get it working. Please let us know if otherwise. If anyone feels like writing the documentation for AA + IntelliJ or AA + IntelliJ + Maven, please go ahead and let us know on the mailing list! |
I've got problems with building my project in eclipse after moving to Android Annotations v.2.7, at the same time maven build is ok. Here is stacktrace from eclipse Error log:
Eclipse session data:
The text was updated successfully, but these errors were encountered: