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 when using @AfterViews #433

Description

@hanbo

Sometimes i get the following error in methods that are using @Afterviews with the HoloEverywhere patched version of android annotations from mikegr #429

Unexpected error. Please report an issue on AndroidAnnotations, with the following content: java.lang.RuntimeException: javax.annotation.processing.FilerException: Source file already created: /XXX/.apt_generated/org/androidannotations/api/SdkVersionHelper.java
    at org.androidannotations.generation.ApiCodeGenerator.writeApiClasses(ApiCodeGenerator.java:79)
    at org.androidannotations.generation.CodeModelGenerator.generate(CodeModelGenerator.java:40)
    at org.androidannotations.AndroidAnnotationProcessor.generateSources(AndroidAnnotationProcessor.java:598)
    at org.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:381)
    at org.androidannotations.AndroidAnnotationProcessor.process(AndroidAnnotationProcessor.java:342)
    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:110)
    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)

It happens in classes that are referencing each other. Eg. in MainActivity i have somewhere LoginActivity_.intent(this).start(); and in LoginActivity a MainActivity_.intent(this).start();

My workaround is to comment out one of the references of the classes. Then they can be build without the error above and i can comment the reference back in and everything is fine. But thats not a real solution.

Activity

  1. pyricau commented on Dec 20, 2012

    @pyricau
    Contributor

    Are you using Eclipse or IntelliJ ? Does that happen with incremental build (ie saving one file in eclipse), or full build (eclipse, ant, maven ?)

  2. hanbo commented on Dec 20, 2012

    @hanbo
    Author

    I am using Eclipse and i have Build Automatically activated. The error occures after inserting a new @Afterviews method in one of the classes that are referencing each other.

    After Project Clean i get another error: eg. in MainActivity: SearchFragment_ cannot be resolved to a type although both SearchFragment and SearchFragment_ exist and the SearchFragment_ is imported. After making a pseudo change in MainActivity and saving it again the error is gone.

  3. pyricau commented on Dec 22, 2012

    @pyricau
    Contributor

    You second problem is a known Eclipse bug

    Regarding the first one, it doesn't seem to be related to HoloEverywhere. If you take care of your second problem (for example by using fully qualified names, and then to a "Project > Clean > Build", does the first error happen ? Or does it happen on incremental build (ie when you save a file) ?

  4. hanbo commented on Jan 11, 2013

    @hanbo
    Author

    Yes, the second bug is fixed with fully qualified names instead of imports (I can do a Project->Clean without error). Thank you for that.

    But the first one is still there. Eg. when i have a fully building situation and then adding eg. @ViewById View myview; to one of thoses files i get that "Source file already created" error.

  5. mathieuboniface commented on Jan 12, 2013

    @mathieuboniface
    Contributor

    Hi @hanbo,

    This error could be related to #410. I will investigate that ASAP.

  6. mathieuboniface commented on Jan 17, 2013

    @mathieuboniface
    Contributor

    Hi @hanbo,

    The last change fix the first issue, in order to fix it in your environment, you can checkout the latest snapshot here.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions