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.

Library Projects with @Background annotation giving Multiple dex files error #750

Description

@yasitha999

Hi I'm using Android Annotations V 3.0 Snapshot,
I have two projects Project A is a library project, Project B is the main project and has an dependency on Project A.

I'm getting following error when I use @ Background annotation in both projects.

Unable to execute dex: Multiple dex files define Lorg/androidannotations/api/BackgroundExecutor$Task;

I think the reason is both projects generate org.androidannotations.api.BackgroundExecutor class.

Any solution??

Activity

  1. DayS commented on Oct 2, 2013

    @DayS
    Contributor

    Yeah, you're right. Both project generate org.androidannotations.api.BackgroundExecutor and Android dex compilation doesn't support duplicated classes.
    We could remove BackgroundExecutor from generating phase (like I already did for all Prefs annotations), but I'm not sure it's the best solution as it'll almost totally revert the feature introduced by @mathieuboniface to shrink down the apk size.

  2. yasitha999 commented on Oct 3, 2013

    @yasitha999
    Author

    Thanks, I'm little-bit new to code generation strategies, any quick fix for this issue? any configuration or something ?

  3. DayS commented on Oct 4, 2013

    @DayS
    Contributor

    Right now, the easiest way right now is to only use @Background or @UIThread in your library OR your final project, not both.

  4. AntekM commented on Jan 16, 2014

    @AntekM

    Isn't it possible to generate API classes just in final project? Or give some option to revert to previous way
    I have more or less half of the app in library project (as there are few apps that share big portion of functionality), so the proposed solution is really far from desirable ;).

  5. yasitha999 commented on Jan 16, 2014

    @yasitha999
    Author

    Agree with @AntekM temporarily I had to use Async Tasks.
    But AA Version 3 is out and as I read this is fixed on AA V3, Haven't testted, Just check release notes, #848 the related issue.

  6. AntekM commented on Jan 16, 2014

    @AntekM

    Ok, thanks - I didn't notice that 3.0.1 is out. This version indeed fixes this problem.

  7. DayS commented on Jan 16, 2014

    @DayS
    Contributor

    Great :)
    I can close this issue then

  8. AntekM commented on Jan 16, 2014

    @AntekM

    It's worth noting that if someone is using gradle, Android Annotations-API cannot be used again as a dependency in final project (should be used just in library project)

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