Closed GoogleCodeExporter closed 8 years ago
Let's see if it's your environment :
- If you create a new Android project from Eclipse, and quickly add
AndroidAnnotations on the created Activity, do you also have that problem ?
However, that's just a check, I think it's probably not related to your
environment. Please follow these instructions to give us information :
- In Eclipse, open Window > Show View > Error Log. If there is an exception in
AndroidAnnotation, you will see it. If that's the case, please double click on
it and paste here the full content of "Exception Stack Trace" field.
- Do you use @EActivity only on BaseActivity, or also on other activities ?
- I'm not sure I understand the exact nature of the problem : do you have a
clear "compile error message", or do you get an unexpected error / stacktrace ?
Original comment by py.ricau
on 26 Nov 2011 at 4:24
Hum... I think I just had the very same error.
I created a new abstract CustomAbstractActivity annotated with @EActivity, and
let all my activities extend the enhanced class (with a _ afterwards). It
worked very well.
Then I did a "Project > Clean", and I saw this error on all activities :
@EActivity can only be used on an element that extends android.app.Activity
Here is the reason why :
When we do a "whole build", all the annotations are processed at once. So the
generated enhanced classes don't exist yet. This means that the type of the
class the our activity extend is "MissingType" (or something like this).
Therefore, it cannot determine what is the type hierarchy, and check that it
extends activity.
To get rid of that error, the only current solution is to stop using abstract
enhanced activity.
An idea on how we can fix that on AndroidAnnotations :
1) Try to deduce the real abstract class from the enhanced class name (not sure
it's possible, because in some compilers we may not have access to the package
name.. maybe checking imports...)
2) Check that the real abstract class holds a @EActivity annotation, and if
yes, then don't issue any compile error
Original comment by py.ricau
on 27 Nov 2011 at 7:42
Original comment by py.ricau
on 28 Nov 2011 at 7:38
This issue was closed by revision 9711bea01194.
Original comment by py.ricau
on 7 Dec 2011 at 7:46
Original issue reported on code.google.com by
py.ricau
on 26 Nov 2011 at 4:16