Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Unexpected error #392

Description

@calexo

Since upgrading from AA 2.6 to 2.7, I have this error.
So the _ classes are no more generated in .apt.
The line the error occurs changes at each compilation time.
I run Eclipse 4.2.1.
Thanks !

Unexpected error. Please report an issue on AndroidAnnotations, with the following content: java.lang.reflect.UndeclaredThrowableException
    at $Proxy20.value(Unknown Source)
    at com.googlecode.androidannotations.processing.rest.RestProcessor.process(RestProcessor.java:84)
    at com.googlecode.androidannotations.processing.ModelProcessor.process(ModelProcessor.java:47)
    at com.googlecode.androidannotations.AndroidAnnotationProcessor.processAnnotations(AndroidAnnotationProcessor.java:472)
    at com.googlecode.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:343)
    at com.googlecode.androidannotations.AndroidAnnotationProcessor.process(AndroidAnnotationProcessor.java:318)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
    at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134)
    at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:820)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:365)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:302)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.NoSuchMethodException: method value() does not exist on annotation@com.googlecode.androidannotations.annotations.rest.Rest
    at org.eclipse.jdt.internal.compiler.apt.model.AnnotationMirrorImpl.invoke(AnnotationMirrorImpl.java:205)
    ... 30 more

Activity

  1. DayS commented on Nov 9, 2012

    @DayS
    Contributor

    Since the 2.7, value() attribute of @Rest annotation has been renamed in rootUrl(). This is explained on issue #377

    Just update this on your code and it should works fine.

  2. mathieuboniface commented on Nov 9, 2012

    @mathieuboniface
    Contributor

    Hi Calexo,

    AndroidAnnotations needs two jars : androidannotations.jar and androidannotations-api.jar

    Could you check these two jars are in the same version ?

    For more informations, see #392, #378 and Configuring eclipse section

    I think you are mixing androidannotation.jar:2.7 and androidannotation-api.jar:2.6

  3. calexo commented on Nov 9, 2012

    @calexo
    Author

    @DayS Thanks, but I already updated my code...
    More, issues are for example on :
    @UiThread
    public void startUI()

    And, not on Rest concerned classes or functions.

    @mathieuboniface Yes, I have androidannotations-2.7.jar in ext-libs/ and androidannotations-api-2.7.jar in libs/

  4. calexo commented on Nov 9, 2012

    @calexo
    Author

    @mathieuboniface #392 is this issue ;-)
    #378 doesn't solve my issue, since the two jars come from the released zip...

  5. DayS commented on Nov 9, 2012

    @DayS
    Contributor

    Hum.

    Line 84 in RestProcessor.java is pointing on an empty line for AA 2.7.
    However, for AA 2.6, this line is the following defaultConstructor.body().assign(holder.rootUrlField, JExpr.lit(typeElement.getAnnotation(Rest.class).value()));. It's seems to fit with the stacktrace.

    Make sure to verify the project configuration. Then try to clean it to force an update and recompilation.

    As @mathieuboniface said, the api and implementation seems to be mixed up for Eclipse cache :)

  6. calexo commented on Nov 9, 2012

    @calexo
    Author

    Well, of course, you're right... 👍
    Sorry...
    A strange link to the 2.6 in another directory was existing in factorypath :-(
    Removing that reference, and now everythings OK !
    Thanks a lot for your quick support !

  7. DayS commented on Nov 9, 2012

    @DayS
    Contributor

    You're welcome :) I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions