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.

Multiple dex files - androidannotations/api/SdkVersionHelper #847

Description

@CumpsD

Hello,

I have a project and 2 Library projects, all 3 of them using androidannotations.

When I build my project, I always get the following error:

[2013-12-30 14:28:06 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/androidannotations/api/SdkVersionHelper$HelperInternal;
[2013-12-30 14:28:06 - iLisa] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/androidannotations/api/SdkVersionHelper$HelperInternal;

I've already tried cleaning the project, restarting eclipse, to no avail. I'm not an expert in Eclipse/Java Classpaths

Anyone who could tell me what I'm doing wrong?

Activity

  1. DayS commented on Dec 30, 2013

    @DayS
    Contributor

    This problem is related to #626.

    AndroidAnnotations copy api classes in project in some cases.
    Currently three classes are copied :

    • SdkVersionHelper if you override onBackPressed method in an enhanced activity
    • BackgroundExecutor if you're using a @Background annotation
    • ViewServer is you're using a @HierarchyViewerSupport annotation

    So, if you're in one of these cases in both library and project you'll have this issue with Eclipse, because the ADT plugin can't deal with duplicate classes in classpath.

    I'll try to find a good solution quickly.

  2. yDelouis commented on Dec 30, 2013

    @yDelouis
    Contributor

    I think that AA shouldn't generate these classes and that these classes should be in the API jar.

  3. CumpsD commented on Dec 30, 2013

    @CumpsD
    Author

    Strange, I don't think I use any of those, will check tommorow if it's perhaps in some superclass

  4. DayS commented on Dec 30, 2013

    @DayS
    Contributor

    @yDelouis > I agree with you. I don't know why I kept generation for these classes. I already prepared a PR for this. I'll continue to test it on some samples and push it very soon

  5. CumpsD commented on Dec 31, 2013

    @CumpsD
    Author

    Weird, I just confirmed, I'm not using onBackPressed anywhere in the project

  6. DayS commented on Dec 31, 2013

    @DayS
    Contributor

    Could you clone the repo and build AA from this PR's banch and tell me if it solves your issue ?

  7. DayS commented on Jan 2, 2014

    @DayS
    Contributor

    All my tests worked successfully. I think it's safe to say it's fixed now in 3.1-SNAPSHOT. Will also be in 3.0.1 hotfix

  8. GrzegorzKapciaKrk commented on Feb 1, 2014

    @GrzegorzKapciaKrk

    I'm using AA 3.0.1 and still have this error.

    Unable to execute dex: Multiple dex files define Lorg/androidannotations/api/SdkVersionHelper$HelperInternal;
    Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/androidannotations/api/SdkVersionHelper$HelperInternal;

  9. DayS commented on Feb 3, 2014

    @DayS
    Contributor

    You shouldn't have it anymore. Could you check again and give us your project conf ?

  10. GrzegorzKapciaKrk commented on Feb 3, 2014

    @GrzegorzKapciaKrk

    I'm using Maven:

        <androidannotations.version>3.0.1</androidannotations.version>
    

    and

        <dependency>
            <groupId>org.androidannotations</groupId>
            <artifactId>androidannotations</artifactId>
            <version>${androidannotations.version}</version>
        </dependency>
    
        <dependency>
            <groupId>org.androidannotations</groupId>
            <artifactId>androidannotations-api</artifactId>
            <version>${androidannotations.version}</version>
        </dependency>
    

    I was using 3.0 before, could it be some issue with maven's imports?

    mvn clean install ends up with success.

  11. DayS commented on Feb 3, 2014

    @DayS
    Contributor

    AA core should be declared with the provided scope. Please read the doc carefully.

  12. GrzegorzKapciaKrk commented on Feb 3, 2014

    @GrzegorzKapciaKrk

    My bad, that helped, sorry for bothering you.

    Additionally i had manualy added factories paths in annotation processing tab in eclipse.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions